Q175: onboarding shows what each mode allows and the amounts a company starts with
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc3127c26f
commit
43dcb1e7d3
11 files changed
+123
-14
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { COMPANY_PRESETS } from "../../shared/company-presets";
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import { RISK_LEVEL, TASK_PRIORITY, TASK_STATUS, WRITING_MODE, type RiskLevel, type WorkLanguage, type WritingMode } from "../../shared/domain";
|
||||
import { ORGANIZATION_DEPARTMENTS } from "./org-governance-service";
|
||||
@@ -20,7 +21,6 @@ import { CEO_FIRST_HIRES } from "./org-building";
|
||||
import type { JsonRecord } from "./provider-http";
|
||||
import type { ToolCall, ToolDefinition } from "./provider-tool-turn";
|
||||
|
||||
const HIRE_BUDGET_CENTS = 25000;
|
||||
const HEARTBEAT_INTERVAL_SEC = 120;
|
||||
|
||||
export interface AgentToolContext {
|
||||
@@ -327,7 +327,7 @@ function hireAgent(deps: AgentToolDeps, ctx: AgentToolContext, args: JsonRecord)
|
||||
department,
|
||||
modelProviderId: ctx.agent.modelProviderId,
|
||||
modelId: model,
|
||||
budgetCents: HIRE_BUDGET_CENTS,
|
||||
budgetCents: COMPANY_PRESETS.agentHireBudgetCents,
|
||||
managerAgentId: ctx.agent.id,
|
||||
roleLevel: seniority,
|
||||
workspaceId: ctx.workspace?.id ?? null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { COMPANY_PRESETS } from "../../shared/company-presets";
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import type {
|
||||
BootstrapOnboardingInput,
|
||||
@@ -60,7 +61,7 @@ export class OnboardingService {
|
||||
department: "Executive",
|
||||
modelProviderId: providerId,
|
||||
modelId: input.providerModel.trim(),
|
||||
budgetCents: 25000,
|
||||
budgetCents: COMPANY_PRESETS.ceoBudgetCents,
|
||||
managerAgentId: null,
|
||||
roleLevel: "c_suite",
|
||||
modelStrategy: "explicit",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { COMPANY_PRESETS } from "../../shared/company-presets";
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import type { CreateAgentInput } from "../../shared/commands";
|
||||
import { RISK_LEVEL, ROUTE_TO_TYPE, type RiskLevel } from "../../shared/domain";
|
||||
@@ -127,14 +128,14 @@ export class OrgGovernanceService {
|
||||
private seedDepartmentPolicy(orgId: string, departmentName: string, now: string): void {
|
||||
this.db.prepare(`
|
||||
insert into org_departments(id, org_id, name, lead_agent_id, headcount_limit, monthly_budget_limit_cents, created_at, updated_at)
|
||||
values (?, ?, ?, null, 12, 2500000, ?, ?)
|
||||
values (?, ?, ?, null, ?, ?, ?, ?)
|
||||
on conflict(org_id, name) do nothing
|
||||
`).run(createId("dep"), orgId, departmentName, now, now);
|
||||
`).run(createId("dep"), orgId, departmentName, COMPANY_PRESETS.departmentHeadcount, COMPANY_PRESETS.departmentBudgetCents, now, now);
|
||||
this.db.prepare(`
|
||||
insert into hiring_policies(id, org_id, department_name, max_headcount, monthly_budget_limit_cents, require_approval_above_cents, created_at, updated_at)
|
||||
values (?, ?, ?, 12, 2500000, 500000, ?, ?)
|
||||
values (?, ?, ?, ?, ?, ?, ?, ?)
|
||||
on conflict(org_id, department_name) do nothing
|
||||
`).run(createId("hpl"), orgId, departmentName, now, now);
|
||||
`).run(createId("hpl"), orgId, departmentName, COMPANY_PRESETS.departmentHeadcount, COMPANY_PRESETS.departmentBudgetCents, COMPANY_PRESETS.hireReviewAboveCents, now, now);
|
||||
}
|
||||
|
||||
private resolveRoutingRule(orgId: string, kind: string, risk: RiskLevel): ApprovalRoutingRuleRow {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { COMPANY_PRESETS } from "../../shared/company-presets";
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import type { CreateOrganizationInput } from "../../shared/commands";
|
||||
import { PROVIDER_CATALOG } from "../../shared/provider-catalog";
|
||||
@@ -68,8 +69,8 @@ export function seedOrganization(db: DatabaseSync, input: CreateOrganizationInpu
|
||||
|
||||
for (const provider of PROVIDER_CATALOG) {
|
||||
db.prepare(`
|
||||
insert into providers(id, org_id, provider_key, label, auth_type, model, credential_id, enabled, created_at)
|
||||
values (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
insert into providers(id, org_id, provider_key, label, auth_type, model, credential_id, enabled, monthly_request_limit, created_at)
|
||||
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`).run(
|
||||
createId("prv"),
|
||||
orgId,
|
||||
@@ -79,6 +80,7 @@ export function seedOrganization(db: DatabaseSync, input: CreateOrganizationInpu
|
||||
provider.defaultModel,
|
||||
null,
|
||||
0,
|
||||
COMPANY_PRESETS.providerMonthlyRequests,
|
||||
now,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { COMPANY_PRESETS } from "../../shared/company-presets";
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import type { RiskLevel } from "../../shared/domain";
|
||||
import { RISK_LEVEL } from "../../shared/domain";
|
||||
@@ -21,7 +22,7 @@ export class PolicyService {
|
||||
this.db.prepare(`
|
||||
insert into policy_rules(id, org_id, subject_type, subject_id, action, effect, risk_ceiling, created_at)
|
||||
values (?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`).run(createId("pol"), orgId, "organization", orgId, "task_create", "require_approval", RISK_LEVEL.MEDIUM, now);
|
||||
`).run(createId("pol"), orgId, "organization", orgId, "task_create", "require_approval", COMPANY_PRESETS.taskRiskCeiling, now);
|
||||
}
|
||||
|
||||
evaluateTaskCreation(orgId: string, risk: RiskLevel): PolicyDecision {
|
||||
|
||||
Reference in new issue
Block a user