@amaster.ai/employee-runtime-connector 0.1.1-beta.224 → 0.1.1-beta.225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amaster-runtime-daemon.mjs +300 -25
- package/dist/amaster-runtime.mjs +1 -1
- package/package.json +1 -1
|
@@ -7592,6 +7592,79 @@ var mirrorxDiscoveryTriageCandidateInputSchema = external_exports.object({
|
|
|
7592
7592
|
}
|
|
7593
7593
|
});
|
|
7594
7594
|
|
|
7595
|
+
// ../shared/src/mirrorx-work-purpose.ts
|
|
7596
|
+
var MIRRORX_CANONICAL_WORK_PURPOSES = [
|
|
7597
|
+
{ code: "activate.customer", workPurposeKey: "customer_activation", label: "\u5BA2\u6237\u6FC0\u6D3B", description: "\u63A8\u52A8\u5BA2\u6237\u8FDB\u5165\u6FC0\u6D3B\u6216\u542F\u7528\u72B6\u6001\u3002", defaultRiskClass: "high", allowedOutcomeClasses: ["external_action", "observed_business_result"] },
|
|
7598
|
+
{ code: "activate.growth-gap", workPurposeKey: "growth_gap_activation", label: "\u589E\u957F\u7F3A\u53E3\u884C\u52A8", description: "\u542F\u52A8\u7528\u4E8E\u6536\u655B\u589E\u957F\u7F3A\u53E3\u7684\u884C\u52A8\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["internal_enablement", "external_action", "observed_business_result"] },
|
|
7599
|
+
{ code: "analyze.activation", workPurposeKey: "activation_analysis", label: "\u6FC0\u6D3B\u5206\u6790", description: "\u5206\u6790\u6FC0\u6D3B\u72B6\u6001\u3001\u8BC1\u636E\u4E0E\u963B\u585E\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7600
|
+
{ code: "analyze.business-gap", workPurposeKey: "business_gap_analysis", label: "\u4E1A\u52A1\u5DEE\u8DDD\u5206\u6790", description: "\u5206\u6790\u5F53\u524D\u7ECF\u8425\u4E8B\u5B9E\u4E0E\u76EE\u6807\u4E4B\u95F4\u7684\u5DEE\u8DDD\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7601
|
+
{ code: "customer.follow_up", workPurposeKey: "customer_follow_up", label: "\u5BA2\u6237\u8DDF\u8FDB", description: "\u63A8\u8FDB\u5DF2\u6709\u5BA2\u6237\u5173\u7CFB\u4E2D\u7684\u660E\u786E\u4E0B\u4E00\u6B65\u3002", defaultRiskClass: "high", allowedOutcomeClasses: ["external_action", "observed_business_result"] },
|
|
7602
|
+
{ code: "decision.memo.v1", workPurposeKey: "decision_memo", label: "\u51B3\u7B56\u5907\u5FD8", description: "\u5F62\u6210\u4F9B\u6CBB\u7406\u51B3\u7B56\u4F7F\u7528\u7684\u53EF\u68C0\u67E5\u5907\u5FD8\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["governed_decision"] },
|
|
7603
|
+
{ code: "execute.operations-gap", workPurposeKey: "operations_gap_execution", label: "\u8FD0\u8425\u7F3A\u53E3\u6267\u884C", description: "\u6267\u884C\u6536\u655B\u5DF2\u786E\u8BA4\u8FD0\u8425\u7F3A\u53E3\u7684\u5DE5\u4F5C\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["internal_enablement", "external_action", "observed_business_result"] },
|
|
7604
|
+
{ code: "finance.baseline", workPurposeKey: "finance_baseline", label: "\u8D22\u52A1\u57FA\u7EBF", description: "\u5EFA\u7ACB\u53EF\u8FFD\u6EAF\u7684\u8D22\u52A1\u4E8B\u5B9E\u57FA\u7EBF\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7605
|
+
{ code: "internal-enablement.activation-memo", workPurposeKey: "activation_enablement_memo", label: "\u6FC0\u6D3B\u51C6\u5907\u6750\u6599", description: "\u5F62\u6210\u89E3\u9664\u6FC0\u6D3B\u963B\u585E\u6240\u9700\u7684\u5185\u90E8\u6750\u6599\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7606
|
+
{ code: "publish_offer", workPurposeKey: "publish_offer", label: "\u53D1\u5E03 Offer", description: "\u53D1\u5E03\u7ECF\u8FC7\u6CBB\u7406\u786E\u8BA4\u7684 Offer\u3002", defaultRiskClass: "high", allowedOutcomeClasses: ["external_action"] },
|
|
7607
|
+
{ code: "renewal_risk_package", workPurposeKey: "renewal_risk_package", label: "\u7EED\u7EA6\u98CE\u9669\u5904\u7F6E\u5305", description: "\u5F62\u6210\u53EF\u6267\u884C\u7684\u7EED\u7EA6\u98CE\u9669\u5206\u6790\u4E0E\u5904\u7F6E\u5305\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["internal_enablement", "governed_decision"] },
|
|
7608
|
+
{ code: "research.product-gap", workPurposeKey: "product_gap_research", label: "\u4EA7\u54C1\u7F3A\u53E3\u8C03\u7814", description: "\u6536\u96C6\u5E76\u6574\u7406\u4EA7\u54C1\u7F3A\u53E3\u6240\u9700\u8BC1\u636E\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7609
|
+
{ code: "retain.customer", workPurposeKey: "customer_retention", label: "\u5BA2\u6237\u7559\u5B58", description: "\u63A8\u8FDB\u5DF2\u786E\u8BA4\u7684\u5BA2\u6237\u7559\u5B58\u52A8\u4F5C\u3002", defaultRiskClass: "high", allowedOutcomeClasses: ["external_action", "observed_business_result"] },
|
|
7610
|
+
{ code: "revenue.follow_up", workPurposeKey: "revenue_follow_up", label: "\u6536\u5165\u673A\u4F1A\u8DDF\u8FDB", description: "\u63A8\u8FDB\u5DF2\u6709\u6536\u5165\u673A\u4F1A\u4E2D\u7684\u660E\u786E\u4E0B\u4E00\u6B65\u3002", defaultRiskClass: "high", allowedOutcomeClasses: ["external_action", "observed_business_result"] },
|
|
7611
|
+
{ code: "review.legacy-evidence", workPurposeKey: "legacy_evidence_review", label: "\u5386\u53F2\u8BC1\u636E\u5BA1\u67E5", description: "\u5BA1\u67E5\u5386\u53F2\u8BC1\u636E\u5E76\u5F62\u6210\u5F53\u524D\u53EF\u7528\u7ED3\u8BBA\u3002", defaultRiskClass: "low", allowedOutcomeClasses: ["internal_enablement"] },
|
|
7612
|
+
{ code: "review_business_outcome", workPurposeKey: "business_outcome_review", label: "\u4E1A\u52A1\u7ED3\u679C\u5BA1\u67E5", description: "\u5BA1\u67E5\u4E1A\u52A1\u7ED3\u679C\u53CA\u5176\u9A8C\u6536\u4E8B\u5B9E\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["governed_decision", "observed_business_result"] },
|
|
7613
|
+
{ code: "validate.product-gap", workPurposeKey: "product_gap_validation", label: "\u4EA7\u54C1\u7F3A\u53E3\u9A8C\u8BC1", description: "\u7528\u53D7\u9650\u5B9E\u9A8C\u9A8C\u8BC1\u4EA7\u54C1\u7F3A\u53E3\u3002", defaultRiskClass: "medium", allowedOutcomeClasses: ["internal_enablement", "observed_business_result"] }
|
|
7614
|
+
];
|
|
7615
|
+
var canonicalWorkKindCodes = MIRRORX_CANONICAL_WORK_PURPOSES.map((entry) => entry.code);
|
|
7616
|
+
var canonicalMirrorxWorkKindSchema = external_exports.enum(canonicalWorkKindCodes);
|
|
7617
|
+
var workPurposeSelectorSchema = external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/u);
|
|
7618
|
+
var mirrorxActivationDomainSchema = external_exports.string().trim().regex(/^[a-z0-9._-]{1,110}$/u);
|
|
7619
|
+
var ceoWorkPurposeSelectionSchema = external_exports.discriminatedUnion("kind", [
|
|
7620
|
+
external_exports.object({
|
|
7621
|
+
kind: external_exports.literal("canonical"),
|
|
7622
|
+
code: canonicalMirrorxWorkKindSchema
|
|
7623
|
+
}).strict(),
|
|
7624
|
+
external_exports.object({
|
|
7625
|
+
kind: external_exports.literal("activation_domain"),
|
|
7626
|
+
domain: mirrorxActivationDomainSchema
|
|
7627
|
+
}).strict(),
|
|
7628
|
+
external_exports.object({
|
|
7629
|
+
kind: external_exports.literal("proposed"),
|
|
7630
|
+
selector: workPurposeSelectorSchema,
|
|
7631
|
+
label: external_exports.string().trim().min(1).max(160),
|
|
7632
|
+
rationale: external_exports.string().trim().min(1).max(2e3)
|
|
7633
|
+
}).strict()
|
|
7634
|
+
]).superRefine((value, ctx) => {
|
|
7635
|
+
if (value.kind === "proposed" && resolveMirrorxWorkKindPurpose(value.selector).status === "mapped") {
|
|
7636
|
+
ctx.addIssue({
|
|
7637
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7638
|
+
path: ["selector"],
|
|
7639
|
+
message: "Proposed work purposes cannot reuse a reserved canonical selector"
|
|
7640
|
+
});
|
|
7641
|
+
}
|
|
7642
|
+
});
|
|
7643
|
+
var canonicalByCode = new Map(
|
|
7644
|
+
MIRRORX_CANONICAL_WORK_PURPOSES.map((entry) => [entry.code, entry])
|
|
7645
|
+
);
|
|
7646
|
+
function resolveMirrorxWorkPurposeSelection(selection) {
|
|
7647
|
+
if (selection.kind === "proposed") {
|
|
7648
|
+
return { status: "unmapped", workKind: selection.selector };
|
|
7649
|
+
}
|
|
7650
|
+
if (selection.kind === "activation_domain") {
|
|
7651
|
+
return {
|
|
7652
|
+
status: "mapped",
|
|
7653
|
+
workKind: `activation.domain-${selection.domain}`,
|
|
7654
|
+
workPurposeKey: "activation_domain"
|
|
7655
|
+
};
|
|
7656
|
+
}
|
|
7657
|
+
const entry = canonicalByCode.get(selection.code);
|
|
7658
|
+
if (!entry) return { status: "unmapped", workKind: selection.code };
|
|
7659
|
+
return { status: "mapped", workKind: entry.code, workPurposeKey: entry.workPurposeKey };
|
|
7660
|
+
}
|
|
7661
|
+
function resolveMirrorxWorkKindPurpose(workKind) {
|
|
7662
|
+
const entry = canonicalByCode.get(workKind);
|
|
7663
|
+
if (entry) return { status: "mapped", workKind, workPurposeKey: entry.workPurposeKey };
|
|
7664
|
+
const domain = /^activation\.domain-([a-z0-9._-]{1,110})$/u.exec(workKind)?.[1];
|
|
7665
|
+
return domain ? resolveMirrorxWorkPurposeSelection({ kind: "activation_domain", domain }) : { status: "unmapped", workKind };
|
|
7666
|
+
}
|
|
7667
|
+
|
|
7595
7668
|
// ../shared/src/task-resource-input.ts
|
|
7596
7669
|
var ATTACHMENT_PREPARATION_VERSION = "attachment-preparation-v1";
|
|
7597
7670
|
var TASK_RESOURCE_INPUT_STATES = [
|
|
@@ -8149,6 +8222,10 @@ var GOAL_GAP_READINESS_REASONS = [
|
|
|
8149
8222
|
"waiting_for_provider",
|
|
8150
8223
|
"waiting_for_identity"
|
|
8151
8224
|
];
|
|
8225
|
+
var GOAL_GAP_INDEPENDENT_OBSERVATION_SOURCE_KINDS = [
|
|
8226
|
+
"provider_object",
|
|
8227
|
+
"governed_business_state"
|
|
8228
|
+
];
|
|
8152
8229
|
var GOAL_CRITERION_DECISION_KINDS = ["goal_scope", "business_result", "fact_correction"];
|
|
8153
8230
|
var GOAL_CRITERION_DECISION_ACTIONS = [
|
|
8154
8231
|
"keep_in_goal",
|
|
@@ -8176,28 +8253,83 @@ function normalizeDecimal(value) {
|
|
|
8176
8253
|
if (!value.includes(".")) return value;
|
|
8177
8254
|
return value.replace(/0+$/, "").replace(/\.$/, "");
|
|
8178
8255
|
}
|
|
8179
|
-
var
|
|
8256
|
+
var goalGapDecimalSchema = external_exports.string().regex(/^(0|[1-9]\d*)(\.\d{1,12})?$/, "Expected a non-negative decimal string").transform(normalizeDecimal);
|
|
8180
8257
|
var comparisonSchema = external_exports.enum(["gte", "lte", "eq"]);
|
|
8258
|
+
var goalGapIndependentObservationSourceKindSchema = external_exports.enum(
|
|
8259
|
+
GOAL_GAP_INDEPENDENT_OBSERVATION_SOURCE_KINDS
|
|
8260
|
+
);
|
|
8261
|
+
function scaledDecimal(value) {
|
|
8262
|
+
const [whole, fraction = ""] = value.split(".");
|
|
8263
|
+
return BigInt(`${whole}${fraction.padEnd(12, "0")}`);
|
|
8264
|
+
}
|
|
8265
|
+
var ratioTargetConditionSchema = external_exports.object({
|
|
8266
|
+
kind: external_exports.literal("ratio"),
|
|
8267
|
+
operator: comparisonSchema,
|
|
8268
|
+
value: goalGapDecimalSchema,
|
|
8269
|
+
ratioType: external_exports.enum(["fraction", "rate", "multiple"]).default("fraction"),
|
|
8270
|
+
displayUnit: external_exports.enum(["percent", "multiple", "decimal"]).default("decimal"),
|
|
8271
|
+
upperBound: goalGapDecimalSchema.optional()
|
|
8272
|
+
}).strict();
|
|
8181
8273
|
var goalGapTargetConditionSchema = external_exports.discriminatedUnion("kind", [
|
|
8182
8274
|
external_exports.object({
|
|
8183
8275
|
kind: external_exports.literal("count"),
|
|
8184
8276
|
operator: comparisonSchema,
|
|
8185
|
-
value: external_exports.number().int().min(0)
|
|
8277
|
+
value: external_exports.number().int().min(0).safe()
|
|
8186
8278
|
}).strict(),
|
|
8187
8279
|
external_exports.object({
|
|
8188
8280
|
kind: external_exports.literal("amount"),
|
|
8189
8281
|
operator: comparisonSchema,
|
|
8190
|
-
value:
|
|
8282
|
+
value: goalGapDecimalSchema,
|
|
8283
|
+
currency: external_exports.string().regex(/^[A-Z]{3}$/)
|
|
8284
|
+
}).strict(),
|
|
8285
|
+
ratioTargetConditionSchema,
|
|
8286
|
+
external_exports.object({
|
|
8287
|
+
kind: external_exports.literal("boolean_milestone"),
|
|
8288
|
+
expected: external_exports.boolean()
|
|
8289
|
+
}).strict()
|
|
8290
|
+
]).superRefine((value, ctx) => {
|
|
8291
|
+
if (value.kind !== "ratio") return;
|
|
8292
|
+
const upperBound = value.upperBound ?? (value.ratioType === "fraction" ? "1" : null);
|
|
8293
|
+
if (value.ratioType === "fraction" && value.upperBound && scaledDecimal(value.upperBound) > scaledDecimal("1")) {
|
|
8294
|
+
ctx.addIssue({
|
|
8295
|
+
code: external_exports.ZodIssueCode.custom,
|
|
8296
|
+
path: ["upperBound"],
|
|
8297
|
+
message: "A fraction upper bound cannot exceed 1"
|
|
8298
|
+
});
|
|
8299
|
+
}
|
|
8300
|
+
if (value.ratioType === "multiple" && value.displayUnit === "percent") {
|
|
8301
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["displayUnit"], message: "A multiple cannot use percent display" });
|
|
8302
|
+
}
|
|
8303
|
+
if (value.ratioType !== "multiple" && value.displayUnit === "multiple") {
|
|
8304
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["displayUnit"], message: "Only multiple ratios can use multiple display" });
|
|
8305
|
+
}
|
|
8306
|
+
if (upperBound && scaledDecimal(value.value) > scaledDecimal(upperBound)) {
|
|
8307
|
+
ctx.addIssue({
|
|
8308
|
+
code: external_exports.ZodIssueCode.custom,
|
|
8309
|
+
path: ["value"],
|
|
8310
|
+
message: "Ratio target exceeds the criterion upper bound"
|
|
8311
|
+
});
|
|
8312
|
+
}
|
|
8313
|
+
});
|
|
8314
|
+
var goalGapObservedValueSchema = external_exports.discriminatedUnion("kind", [
|
|
8315
|
+
external_exports.object({
|
|
8316
|
+
kind: external_exports.literal("count"),
|
|
8317
|
+
value: external_exports.number().int().min(0).safe()
|
|
8318
|
+
}).strict(),
|
|
8319
|
+
external_exports.object({
|
|
8320
|
+
kind: external_exports.literal("amount"),
|
|
8321
|
+
value: goalGapDecimalSchema,
|
|
8191
8322
|
currency: external_exports.string().regex(/^[A-Z]{3}$/)
|
|
8192
8323
|
}).strict(),
|
|
8193
8324
|
external_exports.object({
|
|
8194
8325
|
kind: external_exports.literal("ratio"),
|
|
8195
|
-
|
|
8196
|
-
|
|
8326
|
+
value: goalGapDecimalSchema,
|
|
8327
|
+
ratioType: external_exports.enum(["fraction", "rate", "multiple"]),
|
|
8328
|
+
displayUnit: external_exports.enum(["percent", "multiple", "decimal"])
|
|
8197
8329
|
}).strict(),
|
|
8198
8330
|
external_exports.object({
|
|
8199
8331
|
kind: external_exports.literal("boolean_milestone"),
|
|
8200
|
-
|
|
8332
|
+
value: external_exports.boolean()
|
|
8201
8333
|
}).strict()
|
|
8202
8334
|
]);
|
|
8203
8335
|
var goalGapObservationRefSchema = external_exports.object({
|
|
@@ -8215,6 +8347,59 @@ var goalGapAcceptanceContractSchema = external_exports.discriminatedUnion("verdi
|
|
|
8215
8347
|
acceptanceAuthority: external_exports.object({ kind: external_exports.literal("company_board") }).strict()
|
|
8216
8348
|
}).strict()
|
|
8217
8349
|
]);
|
|
8350
|
+
var GOAL_ACCEPTANCE_EVALUATION_SCHEMA_VERSION = "goal-acceptance-evaluation-v2";
|
|
8351
|
+
var goalAcceptanceEvaluationSpecV2Schema = external_exports.object({
|
|
8352
|
+
schemaVersion: external_exports.literal(GOAL_ACCEPTANCE_EVALUATION_SCHEMA_VERSION),
|
|
8353
|
+
evaluationType: external_exports.enum(GOAL_GAP_EVALUATION_TYPES),
|
|
8354
|
+
businessSubjectScope: boundedRecordSchema,
|
|
8355
|
+
targetCondition: goalGapTargetConditionSchema,
|
|
8356
|
+
window: boundedRecordSchema,
|
|
8357
|
+
observationPolicy: external_exports.object({
|
|
8358
|
+
kind: external_exports.enum([
|
|
8359
|
+
"accepted_causal_delivery",
|
|
8360
|
+
"independent_readback",
|
|
8361
|
+
"board_or_independent_readback",
|
|
8362
|
+
"board_judgment"
|
|
8363
|
+
])
|
|
8364
|
+
}).strict(),
|
|
8365
|
+
acceptanceContract: goalGapAcceptanceContractSchema
|
|
8366
|
+
}).strict().superRefine((value, ctx) => {
|
|
8367
|
+
for (const key of ["kind", "namespace", "objectId"]) {
|
|
8368
|
+
if (typeof value.businessSubjectScope[key] !== "string" || value.businessSubjectScope[key].trim().length === 0) {
|
|
8369
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["businessSubjectScope", key], message: `${key} is required` });
|
|
8370
|
+
}
|
|
8371
|
+
}
|
|
8372
|
+
if (typeof value.window.kind !== "string" || value.window.kind.trim().length === 0) {
|
|
8373
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["window", "kind"], message: "Window kind is required" });
|
|
8374
|
+
}
|
|
8375
|
+
if (value.window.kind === "deadline" && (typeof value.window.targetAt !== "string" || !external_exports.string().datetime({ offset: true }).safeParse(value.window.targetAt).success)) {
|
|
8376
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["window", "targetAt"], message: "Deadline targetAt must be an ISO-8601 timestamp" });
|
|
8377
|
+
}
|
|
8378
|
+
const humanJudgment = value.evaluationType === "human_judgment";
|
|
8379
|
+
if (humanJudgment && value.observationPolicy.kind !== "board_judgment") {
|
|
8380
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["observationPolicy", "kind"], message: "Human judgment must use Board judgment" });
|
|
8381
|
+
}
|
|
8382
|
+
if (humanJudgment && value.acceptanceContract.verdictRequirement !== "human_verdict_required") {
|
|
8383
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["acceptanceContract"], message: "Human judgment requires Company Board authority" });
|
|
8384
|
+
}
|
|
8385
|
+
if (!humanJudgment && value.acceptanceContract.verdictRequirement !== "deterministic_evidence") {
|
|
8386
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["acceptanceContract"], message: "Machine evaluation requires deterministic evidence" });
|
|
8387
|
+
}
|
|
8388
|
+
if (value.evaluationType === "deliverable_milestone") {
|
|
8389
|
+
if (value.targetCondition.kind !== "boolean_milestone") {
|
|
8390
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["targetCondition", "kind"], message: "Deliverable milestones require a boolean target" });
|
|
8391
|
+
}
|
|
8392
|
+
if (value.observationPolicy.kind !== "accepted_causal_delivery") {
|
|
8393
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["observationPolicy", "kind"], message: "Deliverable milestones require accepted causal delivery" });
|
|
8394
|
+
}
|
|
8395
|
+
}
|
|
8396
|
+
if (value.evaluationType === "observed_business_state" && ![
|
|
8397
|
+
"independent_readback",
|
|
8398
|
+
"board_or_independent_readback"
|
|
8399
|
+
].includes(value.observationPolicy.kind)) {
|
|
8400
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["observationPolicy", "kind"], message: "Business state requires an independent or Board readback" });
|
|
8401
|
+
}
|
|
8402
|
+
});
|
|
8218
8403
|
var goalGapEvaluationContractSchema = external_exports.object({
|
|
8219
8404
|
schemaVersion: external_exports.literal("goal-gap-evaluation-v1"),
|
|
8220
8405
|
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
@@ -8232,6 +8417,7 @@ var goalGapEvaluationContractSchema = external_exports.object({
|
|
|
8232
8417
|
])
|
|
8233
8418
|
}).strict(),
|
|
8234
8419
|
compilerRevision: external_exports.string().min(1).max(120),
|
|
8420
|
+
compilerSource: external_exports.enum(["explicit_v2", "legacy_heuristic"]).optional().default("legacy_heuristic"),
|
|
8235
8421
|
evaluationContractHash: sha256Schema5,
|
|
8236
8422
|
targetHash: sha256Schema5
|
|
8237
8423
|
}).strict().superRefine((value, ctx) => {
|
|
@@ -8549,6 +8735,22 @@ var goalCriterionProgressReadModelSchema = external_exports.object({
|
|
|
8549
8735
|
kind: external_exports.enum(["boolean", "count", "amount", "ratio"]),
|
|
8550
8736
|
currency: external_exports.string().regex(/^[A-Z]{3}$/).nullable()
|
|
8551
8737
|
}).strict().nullable(),
|
|
8738
|
+
automaticReadiness: external_exports.object({
|
|
8739
|
+
state: external_exports.enum([
|
|
8740
|
+
"ready",
|
|
8741
|
+
"evaluated",
|
|
8742
|
+
"waiting_for_provider",
|
|
8743
|
+
"waiting_for_observation",
|
|
8744
|
+
"not_applicable"
|
|
8745
|
+
]),
|
|
8746
|
+
label: external_exports.string().min(1),
|
|
8747
|
+
detail: external_exports.string().min(1),
|
|
8748
|
+
requiredValueKind: external_exports.enum(GOAL_GAP_METRIC_KINDS),
|
|
8749
|
+
sourceBinding: external_exports.object({
|
|
8750
|
+
namespace: external_exports.string().min(1),
|
|
8751
|
+
objectId: external_exports.string().min(1)
|
|
8752
|
+
}).strict().nullable()
|
|
8753
|
+
}).strict().nullable(),
|
|
8552
8754
|
factSummary: external_exports.string().min(1),
|
|
8553
8755
|
unknownSummary: external_exports.string().min(1).nullable(),
|
|
8554
8756
|
sourceSummary: external_exports.array(external_exports.string().min(1)).max(20),
|
|
@@ -8578,7 +8780,7 @@ var correctedGoalCriterionFactSchema = external_exports.object({
|
|
|
8578
8780
|
value: external_exports.union([
|
|
8579
8781
|
external_exports.boolean(),
|
|
8580
8782
|
external_exports.number().finite().nonnegative(),
|
|
8581
|
-
|
|
8783
|
+
goalGapDecimalSchema
|
|
8582
8784
|
]),
|
|
8583
8785
|
asOf: external_exports.string().datetime({ offset: true }),
|
|
8584
8786
|
source: correctedFactSourceSchema
|
|
@@ -8607,7 +8809,7 @@ var boardDecideGoalCriterionSchema = external_exports.discriminatedUnion("action
|
|
|
8607
8809
|
}).strict(),
|
|
8608
8810
|
boardDecideGoalCriterionBaseSchema.extend({
|
|
8609
8811
|
action: external_exports.literal("wait_for_external_fact"),
|
|
8610
|
-
awaitedFactKind:
|
|
8812
|
+
awaitedFactKind: goalGapIndependentObservationSourceKindSchema,
|
|
8611
8813
|
expectedAt: external_exports.string().datetime({ offset: true }).optional()
|
|
8612
8814
|
}).strict()
|
|
8613
8815
|
]);
|
|
@@ -11513,8 +11715,7 @@ var ceoPeriodicPortfolioAdmissionSchema = external_exports.object({
|
|
|
11513
11715
|
});
|
|
11514
11716
|
}
|
|
11515
11717
|
});
|
|
11516
|
-
var
|
|
11517
|
-
workKind: external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/u),
|
|
11718
|
+
var ceoPeriodicDiscoveredWorkInputShape = {
|
|
11518
11719
|
title: external_exports.string().trim().min(1).max(240),
|
|
11519
11720
|
description: external_exports.string().trim().min(1).max(8e3),
|
|
11520
11721
|
whyNow: external_exports.string().trim().min(1).max(2e3),
|
|
@@ -11529,7 +11730,8 @@ var ceoPeriodicDiscoveredWorkInputSchema = external_exports.object({
|
|
|
11529
11730
|
executionShape: external_exports.enum(["direct", "team_decomposition", "agent_decides"]).default("agent_decides"),
|
|
11530
11731
|
completionStrategy: external_exports.enum(["single_aggregation", "multi_acceptance"]).nullable().default(null),
|
|
11531
11732
|
portfolioAdmission: ceoPeriodicPortfolioAdmissionSchema.optional()
|
|
11532
|
-
}
|
|
11733
|
+
};
|
|
11734
|
+
function validateCeoPeriodicDiscoveredWorkShape(value, ctx) {
|
|
11533
11735
|
if (value.executionShape === "team_decomposition" && !value.completionStrategy) {
|
|
11534
11736
|
ctx.addIssue({
|
|
11535
11737
|
code: external_exports.ZodIssueCode.custom,
|
|
@@ -11544,7 +11746,22 @@ var ceoPeriodicDiscoveredWorkInputSchema = external_exports.object({
|
|
|
11544
11746
|
message: "Only team decomposition may declare a completion strategy"
|
|
11545
11747
|
});
|
|
11546
11748
|
}
|
|
11547
|
-
}
|
|
11749
|
+
}
|
|
11750
|
+
var ceoPeriodicLegacyDiscoveredWorkInputSchema = external_exports.object({
|
|
11751
|
+
...ceoPeriodicDiscoveredWorkInputShape,
|
|
11752
|
+
workKind: external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/u)
|
|
11753
|
+
}).strict().superRefine(validateCeoPeriodicDiscoveredWorkShape);
|
|
11754
|
+
var ceoPeriodicStructuredDiscoveredWorkInputSchema = external_exports.object({
|
|
11755
|
+
...ceoPeriodicDiscoveredWorkInputShape,
|
|
11756
|
+
workPurpose: ceoWorkPurposeSelectionSchema
|
|
11757
|
+
}).strict().superRefine(validateCeoPeriodicDiscoveredWorkShape).transform((value) => ({
|
|
11758
|
+
...value,
|
|
11759
|
+
workKind: resolveMirrorxWorkPurposeSelection(value.workPurpose).workKind
|
|
11760
|
+
}));
|
|
11761
|
+
var ceoPeriodicDiscoveredWorkInputSchema = external_exports.union([
|
|
11762
|
+
ceoPeriodicStructuredDiscoveredWorkInputSchema,
|
|
11763
|
+
ceoPeriodicLegacyDiscoveredWorkInputSchema
|
|
11764
|
+
]);
|
|
11548
11765
|
var ceoPeriodicGoalGapCandidateSchema = external_exports.object({
|
|
11549
11766
|
candidateGapKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/u),
|
|
11550
11767
|
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
@@ -12051,6 +12268,14 @@ var governedBusinessTaskWakeDispatchSchema = external_exports.object({
|
|
|
12051
12268
|
deliveredAt: external_exports.string().datetime({ offset: true }).nullable(),
|
|
12052
12269
|
lastError: external_exports.string().nullable()
|
|
12053
12270
|
}).strict();
|
|
12271
|
+
var governedBusinessTaskDiscoverySourceSchema = external_exports.object({
|
|
12272
|
+
controllerIssue: external_exports.object({
|
|
12273
|
+
id: external_exports.string().uuid(),
|
|
12274
|
+
identifier: external_exports.string().nullable(),
|
|
12275
|
+
title: external_exports.string()
|
|
12276
|
+
}).strict(),
|
|
12277
|
+
routineRunId: external_exports.string().uuid().nullable()
|
|
12278
|
+
}).strict();
|
|
12054
12279
|
var governedBusinessTaskEnrollmentReadModelSchema = external_exports.object({
|
|
12055
12280
|
state: external_exports.enum(BUSINESS_TASK_ENROLLMENT_READ_STATES),
|
|
12056
12281
|
companyId: external_exports.string().uuid(),
|
|
@@ -12059,6 +12284,7 @@ var governedBusinessTaskEnrollmentReadModelSchema = external_exports.object({
|
|
|
12059
12284
|
taskRequirements: issueTaskRequirementsSchema,
|
|
12060
12285
|
enrollment: governedBusinessTaskEnrollmentSchema.nullable(),
|
|
12061
12286
|
dispatch: governedBusinessTaskWakeDispatchSchema.nullable(),
|
|
12287
|
+
discoverySource: governedBusinessTaskDiscoverySourceSchema.nullable(),
|
|
12062
12288
|
finding: external_exports.object({
|
|
12063
12289
|
code: external_exports.string().trim().min(1),
|
|
12064
12290
|
message: external_exports.string().trim().min(1)
|
|
@@ -12092,17 +12318,36 @@ var companyWorkPurposeCatalogEntrySchema = external_exports.object({
|
|
|
12092
12318
|
status: companyWorkPurposeCatalogEntryStatusSchema,
|
|
12093
12319
|
sourceCandidateId: external_exports.string().uuid()
|
|
12094
12320
|
}).strict();
|
|
12095
|
-
var
|
|
12096
|
-
|
|
12321
|
+
var optionalDecisionRationaleSchema = external_exports.preprocess(
|
|
12322
|
+
(value) => typeof value === "string" && value.trim().length === 0 ? null : value,
|
|
12323
|
+
external_exports.string().trim().min(1).max(2e3).nullable().optional()
|
|
12324
|
+
);
|
|
12325
|
+
var businessDemandDecisionShape = {
|
|
12097
12326
|
interactionId: external_exports.string().uuid(),
|
|
12098
12327
|
expectedRevision: external_exports.number().int().positive(),
|
|
12099
12328
|
idempotencyKey: external_exports.string().trim().min(8).max(200),
|
|
12100
12329
|
decision: external_exports.enum(["reject", "approve_once", "approve_reusable"]),
|
|
12101
|
-
rationale:
|
|
12102
|
-
}
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12330
|
+
rationale: optionalDecisionRationaleSchema
|
|
12331
|
+
};
|
|
12332
|
+
function requireReusableDecisionRationale(schema) {
|
|
12333
|
+
return schema.superRefine((value, context) => {
|
|
12334
|
+
if (value.decision !== "approve_reusable" || value.rationale) return;
|
|
12335
|
+
context.addIssue({
|
|
12336
|
+
code: external_exports.ZodIssueCode.custom,
|
|
12337
|
+
path: ["rationale"],
|
|
12338
|
+
message: "Reusable automatic work approval requires a rationale"
|
|
12339
|
+
});
|
|
12340
|
+
});
|
|
12341
|
+
}
|
|
12342
|
+
var boardDecideCompanyWorkPurposeCandidateSchema = requireReusableDecisionRationale(
|
|
12343
|
+
external_exports.object({
|
|
12344
|
+
candidateId: external_exports.string().uuid(),
|
|
12345
|
+
...businessDemandDecisionShape
|
|
12346
|
+
}).strict()
|
|
12347
|
+
);
|
|
12348
|
+
var boardDecideBusinessDemandSchema = requireReusableDecisionRationale(
|
|
12349
|
+
external_exports.object(businessDemandDecisionShape).strict()
|
|
12350
|
+
);
|
|
12106
12351
|
var boardDisableCompanyWorkPurposeCatalogEntrySchema = external_exports.object({
|
|
12107
12352
|
expectedRevision: external_exports.number().int().positive(),
|
|
12108
12353
|
idempotencyKey: external_exports.string().trim().min(8).max(200),
|
|
@@ -14511,9 +14756,16 @@ var goalAcceptanceCriteriaSchema = external_exports.array(
|
|
|
14511
14756
|
).min(1).max(10);
|
|
14512
14757
|
var goalAcceptanceCriteriaItemSchema = external_exports.object({
|
|
14513
14758
|
id: external_exports.string().uuid().optional(),
|
|
14514
|
-
text: external_exports.string().trim().min(1).max(1e3)
|
|
14759
|
+
text: external_exports.string().trim().min(1).max(1e3),
|
|
14760
|
+
evaluation: goalAcceptanceEvaluationSpecV2Schema.optional()
|
|
14515
14761
|
}).strict();
|
|
14516
14762
|
var goalAcceptanceCriteriaItemsSchema = external_exports.array(goalAcceptanceCriteriaItemSchema).min(1).max(10);
|
|
14763
|
+
var goalAcceptanceCriterionDraftV2Schema = external_exports.object({
|
|
14764
|
+
id: external_exports.string().uuid().optional(),
|
|
14765
|
+
text: external_exports.string().trim().min(1).max(1e3),
|
|
14766
|
+
evaluation: goalAcceptanceEvaluationSpecV2Schema
|
|
14767
|
+
}).strict();
|
|
14768
|
+
var goalAcceptanceCriteriaItemsV2Schema = external_exports.array(goalAcceptanceCriterionDraftV2Schema).min(1).max(10);
|
|
14517
14769
|
var goalStringListSchema = external_exports.array(external_exports.string().trim().min(1).max(1e3)).max(20);
|
|
14518
14770
|
var goalSourceRefSchema = external_exports.object({
|
|
14519
14771
|
kind: external_exports.string().trim().min(1).max(100),
|
|
@@ -14574,11 +14826,10 @@ var createGoalProposalSchema = external_exports.object({
|
|
|
14574
14826
|
var goalProposalMessageSchema = external_exports.object({
|
|
14575
14827
|
message: external_exports.string().trim().min(1).max(8e3)
|
|
14576
14828
|
}).strict();
|
|
14577
|
-
var
|
|
14829
|
+
var goalProposalRevisionBaseShape = {
|
|
14578
14830
|
title: external_exports.string().trim().min(1).max(300),
|
|
14579
14831
|
description: external_exports.string().trim().min(1).max(8e3),
|
|
14580
14832
|
findingSummary: external_exports.string().trim().min(1).max(4e3),
|
|
14581
|
-
acceptanceCriteria: goalAcceptanceCriteriaSchema,
|
|
14582
14833
|
assumptions: goalStringListSchema.optional().default([]),
|
|
14583
14834
|
unknowns: goalStringListSchema.optional().default([]),
|
|
14584
14835
|
constraints: goalStringListSchema.optional().default([]),
|
|
@@ -14586,7 +14837,31 @@ var goalProposalRevisionInputSchema = external_exports.object({
|
|
|
14586
14837
|
proposedOutcomeOwnerUserId: external_exports.string().trim().min(1).max(200),
|
|
14587
14838
|
proposedOwnerAgentId: external_exports.string().uuid().optional().nullable(),
|
|
14588
14839
|
targetAt: external_exports.coerce.date()
|
|
14589
|
-
}
|
|
14840
|
+
};
|
|
14841
|
+
var typedGoalProposalRevisionInputSchema = external_exports.object({
|
|
14842
|
+
...goalProposalRevisionBaseShape,
|
|
14843
|
+
acceptanceCriteriaItems: goalAcceptanceCriteriaItemsV2Schema
|
|
14844
|
+
}).strict().transform((value) => ({
|
|
14845
|
+
...value,
|
|
14846
|
+
acceptanceCriteria: value.acceptanceCriteriaItems.map((item) => item.text)
|
|
14847
|
+
}));
|
|
14848
|
+
var normalizedTypedGoalProposalRevisionInputSchema = external_exports.object({
|
|
14849
|
+
...goalProposalRevisionBaseShape,
|
|
14850
|
+
acceptanceCriteriaItems: goalAcceptanceCriteriaItemsV2Schema,
|
|
14851
|
+
acceptanceCriteria: goalAcceptanceCriteriaSchema
|
|
14852
|
+
}).strict().superRefine((value, ctx) => {
|
|
14853
|
+
if (value.acceptanceCriteria.length !== value.acceptanceCriteriaItems.length || value.acceptanceCriteria.some((text2, index) => text2 !== value.acceptanceCriteriaItems[index]?.text)) {
|
|
14854
|
+
ctx.addIssue({
|
|
14855
|
+
code: external_exports.ZodIssueCode.custom,
|
|
14856
|
+
path: ["acceptanceCriteria"],
|
|
14857
|
+
message: "Acceptance criteria projection does not match typed items"
|
|
14858
|
+
});
|
|
14859
|
+
}
|
|
14860
|
+
});
|
|
14861
|
+
var goalProposalRevisionInputSchema = external_exports.union([
|
|
14862
|
+
typedGoalProposalRevisionInputSchema,
|
|
14863
|
+
normalizedTypedGoalProposalRevisionInputSchema
|
|
14864
|
+
]);
|
|
14590
14865
|
var acceptGoalProposalSchema = external_exports.object({
|
|
14591
14866
|
revisionId: external_exports.string().uuid()
|
|
14592
14867
|
}).strict();
|
|
@@ -20273,7 +20548,7 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
20273
20548
|
const DELEGATED_PROFILE_MARKER = ".amaster-delegated-pi-profile.json";
|
|
20274
20549
|
const SESSION_ROLLOUT_MARKER2 = ".amaster-pi-session-rollout.json";
|
|
20275
20550
|
const DEFAULT_SESSION_ROLLOUT_TTL_MS2 = 24 * 60 * 60 * 1e3;
|
|
20276
|
-
const PI_VERSION_ATTESTATION_TIMEOUT_MS =
|
|
20551
|
+
const PI_VERSION_ATTESTATION_TIMEOUT_MS = 3e4;
|
|
20277
20552
|
const PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS = 6e4;
|
|
20278
20553
|
const PI_EFFECTIVE_TOOLS_RETRY_TIMEOUT_MS = 3e4;
|
|
20279
20554
|
const PI_EFFECTIVE_TOOLS_TOTAL_TIMEOUT_MS = PI_EFFECTIVE_TOOLS_ATTESTATION_TIMEOUT_MS + PI_EFFECTIVE_TOOLS_RETRY_TIMEOUT_MS;
|
|
@@ -29587,7 +29862,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
|
|
|
29587
29862
|
}
|
|
29588
29863
|
|
|
29589
29864
|
// src/amaster-runtime-daemon.mjs
|
|
29590
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
29865
|
+
var CONNECTOR_VERSION = "0.1.1-beta.225";
|
|
29591
29866
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
29592
29867
|
var daemonRequire = createRequire(import.meta.url);
|
|
29593
29868
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { homedir, hostname } from "node:os";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
|
|
9
9
|
|
|
10
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
10
|
+
const CONNECTOR_VERSION = "0.1.1-beta.225";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|