@amaster.ai/employee-runtime-connector 0.1.1-beta.287 → 0.1.1-beta.289

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.
@@ -5951,6 +5951,7 @@ var ISSUE_THREAD_INTERACTION_KINDS = [
5951
5951
  var ISSUE_THREAD_INTERACTION_SETTLEMENT_PURPOSE_CODES = [
5952
5952
  "request_required_inputs",
5953
5953
  "clarify_required_scope",
5954
+ "business_data_source_selection",
5954
5955
  "resolve_staffing_gap",
5955
5956
  "review_suggested_tasks",
5956
5957
  "choose_task_disposition",
@@ -10113,7 +10114,7 @@ var scheduleIssueRecoveryMonitorSchema = external_exports.object({
10113
10114
  nextCheckAt: external_exports.string().datetime()
10114
10115
  }).strict();
10115
10116
  var issueRequestDepthInputSchema = external_exports.number().int().nonnegative().transform((value) => clampIssueRequestDepth(value));
10116
- var estimatedLaborHoursSchema = external_exports.number().finite().nonnegative().max(1e6);
10117
+ var estimatedLaborHoursSchema = external_exports.number().finite().positive().max(1e6);
10117
10118
  var issueDateSchema = external_exports.string().refine((value) => {
10118
10119
  const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
10119
10120
  if (!match) return false;
@@ -10213,13 +10214,22 @@ function addExactlyOneTaskDirectionIssue(value, ctx) {
10213
10214
  if (count2 === 1) return;
10214
10215
  ctx.addIssue({
10215
10216
  code: external_exports.ZodIssueCode.custom,
10216
- path: ["labelIds"],
10217
+ path: value.labels?.length && !value.labelIds?.length ? ["labels"] : ["labelIds"],
10217
10218
  message: count2 === 0 ? "Task direction is required" : "Exactly one task direction is required",
10218
10219
  params: {
10219
10220
  code: count2 === 0 ? "task_direction_required" : "task_direction_exactly_one_required"
10220
10221
  }
10221
10222
  });
10222
10223
  }
10224
+ function addRequiredEstimatedLaborIssue(value, ctx) {
10225
+ if (value.estimatedLaborHours !== void 0 && value.estimatedLaborHours !== null) return;
10226
+ ctx.addIssue({
10227
+ code: external_exports.ZodIssueCode.custom,
10228
+ path: ["estimatedLaborHours"],
10229
+ message: "Estimated labor hours are required",
10230
+ params: { code: "estimated_labor_hours_required" }
10231
+ });
10232
+ }
10223
10233
  var createIssueInputSchema = createIssueBaseSchema.extend({
10224
10234
  status: createIssueBaseSchema.shape.status.optional(),
10225
10235
  labels: createIssueLabelNamesSchema.optional()
@@ -10241,10 +10251,19 @@ var createModelIssueSchema = createIssueSchema.superRefine((value, ctx) => {
10241
10251
  if (value.prerequisiteSlots !== void 0 || value.prerequisiteChecks !== void 0) {
10242
10252
  ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["prerequisiteSlots"], message: "Model creation cannot declare cross-Issue prerequisite authority" });
10243
10253
  }
10254
+ const mirrorxAgentSession = value.creationProfile === MIRRORX_AGENT_SESSION_CREATION_PROFILE;
10244
10255
  const systemWatchdogFollowUp = value.watchdogDiscovery?.kind === "product_bug";
10245
- if (!systemWatchdogFollowUp && (value.taskIntent === "business" || value.parentId)) {
10246
- addExactlyOneTaskDirectionIssue(value, ctx);
10256
+ if (mirrorxAgentSession || systemWatchdogFollowUp) return;
10257
+ if (!value.parentId && value.taskIntent !== "business") {
10258
+ ctx.addIssue({
10259
+ code: external_exports.ZodIssueCode.custom,
10260
+ path: ["taskIntent"],
10261
+ message: "Model-created root tasks must use business intent",
10262
+ params: { code: "model_business_task_intent_required" }
10263
+ });
10247
10264
  }
10265
+ addExactlyOneTaskDirectionIssue(value, ctx);
10266
+ addRequiredEstimatedLaborIssue(value, ctx);
10248
10267
  });
10249
10268
  var upsertIssueWatchdogSchema = external_exports.object({
10250
10269
  agentId: external_exports.string().uuid(),
@@ -10274,9 +10293,10 @@ var createChildIssueSchema = withCreateIssueStatusDefault(createIssueBaseSchema.
10274
10293
  inputWorkProductIds: external_exports.array(external_exports.string().uuid()).max(50).optional(),
10275
10294
  labels: createIssueLabelNamesSchema.optional()
10276
10295
  }));
10277
- var createModelChildIssueSchema = createChildIssueSchema.superRefine(
10278
- addExactlyOneTaskDirectionIssue
10279
- );
10296
+ var createModelChildIssueSchema = createChildIssueSchema.superRefine((value, ctx) => {
10297
+ addExactlyOneTaskDirectionIssue(value, ctx);
10298
+ addRequiredEstimatedLaborIssue(value, ctx);
10299
+ });
10280
10300
  var createAcceptedPlanDecompositionSchema = external_exports.object({
10281
10301
  acceptedPlanRevisionId: external_exports.string().uuid(),
10282
10302
  children: external_exports.array(createModelChildIssueSchema).min(1).max(25)
@@ -10482,7 +10502,7 @@ var suggestedTaskDraftSchema = external_exports.object({
10482
10502
  title: external_exports.string().trim().min(1).max(240),
10483
10503
  description: multilineTextSchema.pipe(external_exports.string().trim().max(2e4)).nullable().optional(),
10484
10504
  delegation: issueDelegationInputSchema,
10485
- estimatedLaborHours: estimatedLaborHoursSchema.positive().nullable().optional(),
10505
+ estimatedLaborHours: estimatedLaborHoursSchema.nullable().optional(),
10486
10506
  priority: external_exports.enum(ISSUE_PRIORITIES).nullable().optional(),
10487
10507
  workMode: external_exports.enum(ISSUE_WORK_MODES).nullable().optional(),
10488
10508
  assigneeAgentId: external_exports.string().uuid().nullable().optional(),
@@ -10560,6 +10580,28 @@ var suggestTasksPayloadSchema = external_exports.object({
10560
10580
  seenClientKeys.add(task.clientKey);
10561
10581
  }
10562
10582
  });
10583
+ var modelSuggestedTaskDraftSchema = suggestedTaskDraftSchema.superRefine((value, ctx) => {
10584
+ addExactlyOneTaskDirectionIssue(value, ctx);
10585
+ addRequiredEstimatedLaborIssue(value, ctx);
10586
+ });
10587
+ var modelSuggestTasksPayloadSchema = external_exports.object({
10588
+ version: external_exports.literal(1),
10589
+ defaultParentId: external_exports.string().uuid().nullable().optional(),
10590
+ tasks: external_exports.array(modelSuggestedTaskDraftSchema).min(1).max(50)
10591
+ }).superRefine((value, ctx) => {
10592
+ const seenClientKeys = /* @__PURE__ */ new Set();
10593
+ for (const [index, task] of value.tasks.entries()) {
10594
+ if (seenClientKeys.has(task.clientKey)) {
10595
+ ctx.addIssue({
10596
+ code: external_exports.ZodIssueCode.custom,
10597
+ message: "clientKey must be unique within one interaction",
10598
+ path: ["tasks", index, "clientKey"]
10599
+ });
10600
+ continue;
10601
+ }
10602
+ seenClientKeys.add(task.clientKey);
10603
+ }
10604
+ });
10563
10605
  var suggestTasksResultCreatedTaskSchema = external_exports.object({
10564
10606
  clientKey: external_exports.string().trim().min(1).max(120),
10565
10607
  workKey: external_exports.string().trim().min(1).max(120).nullable().optional(),
@@ -14566,6 +14608,25 @@ var routineTemplateAdoptionBatchSchema = external_exports.object({
14566
14608
  afterCompanyId: external_exports.string().uuid().optional().nullable(),
14567
14609
  limit: external_exports.number().int().min(1).max(25).optional()
14568
14610
  }).strict();
14611
+ var routineTaskProfileMigrationPreviewSchema = external_exports.object({}).strict();
14612
+ var routineTaskProfileMigrationApplySchema = external_exports.object({
14613
+ operationKey: external_exports.string().trim().min(1).max(200),
14614
+ confirmation: external_exports.literal("APPLY_ROUTINE_TASK_PROFILES"),
14615
+ assignments: external_exports.array(external_exports.object({
14616
+ routineId: external_exports.string().uuid(),
14617
+ taskDirectionLabelId: external_exports.string().uuid(),
14618
+ estimatedLaborHours: external_exports.number().finite().positive().max(1e6),
14619
+ confirmedCanonicalKey: external_exports.string().trim().min(1).max(100).optional()
14620
+ }).strict()).min(1).max(500)
14621
+ }).strict().superRefine((value, ctx) => {
14622
+ if (new Set(value.assignments.map((item) => item.routineId)).size !== value.assignments.length) {
14623
+ ctx.addIssue({
14624
+ code: external_exports.ZodIssueCode.custom,
14625
+ path: ["assignments"],
14626
+ message: "Routine IDs must be unique"
14627
+ });
14628
+ }
14629
+ });
14569
14630
  var routineRevisionSnapshotRoutineV1Schema = external_exports.object({
14570
14631
  id: external_exports.string().uuid(),
14571
14632
  companyId: external_exports.string().uuid(),
@@ -30026,9 +30087,9 @@ function runtimeAuthorizationText(context, mode, {
30026
30087
  ].join(" ") : "";
30027
30088
  const businessOutcomeTerminalContract = !suppressOrdinaryCompletionContract && businessOutcome.mode === "required" ? [
30028
30089
  pendingExecutionStages.length > 0 ? "When producer-owned deliverable requirements are satisfied and the exact current Delivery Manifest is ready when required, record final production evidence with update_parent status in_progress and end the run successfully. Independent review and approval requirements belong to the subsequent configured stages." : delivery.mode === "required" ? delegatedDelivery ? "When every acceptance criterion is satisfied and the exact delegated final-child Manifest and package review remain current, record only the root execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating or publishing another package." : "When every acceptance criterion is satisfied and the exact current Delivery Manifest is ready, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction." : "When every acceptance criterion is satisfied, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction.",
30029
- "The exact runtime_action_in_progress_server_owned rejection is the expected fail-before-effect receipt for this Server-owned handoff. After receiving it, do not retry update_parent with done or another status; end the run successfully so the Server terminal reconciler can take over.",
30030
- "A ready Delivery Manifest proves only that delivery evidence was registered; it is not Acceptance or an accepted Business Outcome. The expected runtime_action_in_progress_server_owned receipt likewise does not prove finalization. Unless an authoritative Server receipt already confirms acceptance and task completion, state that evidence was submitted and Server terminal validation is pending; do not claim the task is accepted or done. A pre-terminal outcome_not_clean result may reflect a still-running producer; preserve that result without declaring either final success or permanent failure, and do not poll or retry mutations to force closure.",
30031
- pendingExecutionStages.length > 0 ? "After successful production and terminal evidence validation, the Server must complete the remaining configured execution stages before applying the Business Outcome acceptance policy. Evidence-auto acceptance does not skip independent Review or Approval. Do not create a duplicate final confirmation interaction." : evidenceAutoAcceptance ? delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server validate the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : "Only after the run and command succeed does the Server validate the exact current Delivery Manifest and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : "Only after the run and command succeed does the Server validate the terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server bind the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the exact current Delivery Manifest and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically."
30090
+ "The exact runtime_action_in_progress_server_owned rejection is the expected fail-before-effect receipt for this Server-owned handoff. After receiving it, do not retry update_parent with done or another status; end the run successfully so the Server terminal reconciler can take over. An expected execution receipt does not require a separate user update; retain it in the execution record unless the user requested runtime diagnostics.",
30091
+ "A ready Delivery Manifest proves only that delivery evidence was registered; it is not Acceptance or an accepted Business Outcome. The expected runtime_action_in_progress_server_owned receipt likewise does not prove finalization. Unless an authoritative Server receipt already confirms acceptance and task completion, tell the reader in their selected language what was delivered and that final confirmation is still pending; do not claim the task is accepted or done. Describe this practical outcome without copying internal protocol terminology into the reply unless the user requested those technical details. A pre-terminal outcome_not_clean result may reflect a still-running producer; preserve that result in the execution record without declaring either final success or permanent failure, and do not poll or retry mutations to force closure. Explain any actual unresolved effect on the deliverable in the reader's language rather than echoing the protocol status.",
30092
+ pendingExecutionStages.length > 0 ? "After successful production and terminal evidence validation, the Server must complete the remaining configured execution stages before applying the Business Outcome acceptance policy. Evidence-auto acceptance does not skip independent Review or Approval. Do not create a duplicate final confirmation interaction." : evidenceAutoAcceptance ? delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server validate the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; explain the observed delivery and confirmation status in the reader's selected language without implying that human review is required." : "Only after the run and command succeed does the Server validate the exact current Delivery Manifest and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; explain the observed delivery and confirmation status in the reader's selected language without implying that human review is required." : "Only after the run and command succeed does the Server validate the terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; explain the observed delivery and confirmation status in the reader's selected language without implying that human review is required." : delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server bind the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the exact current Delivery Manifest and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically."
30032
30093
  ].join(" ") : "";
30033
30094
  const organizationCapabilityAllowed = asRecord(envelope.organizationCapability).allowed === true;
30034
30095
  const organizationMutationAuthorized = allowed.has("organization_mutation");
@@ -30056,7 +30117,8 @@ function runtimeAuthorizationText(context, mode, {
30056
30117
  businessOutcomeOwnershipContract,
30057
30118
  businessOutcomeTerminalContract,
30058
30119
  authorizationContract,
30059
- exactOrganizationReplay
30120
+ exactOrganizationReplay,
30121
+ completionContract || businessOutcomeOwnershipContract || businessOutcomeTerminalContract || authorizationContract || exactOrganizationReplay ? "Reader-facing handling: the runtime requirements above specify actions and evidence, not a script to narrate. Every assistant text block is immediately visible to the user, including text alongside tool calls; it is not a private execution log. After a routine tool result, make the next tool call directly. Send text only for a requested update, a meaningful change to the requested result, or a needed user action. A successful internal check or an expected protocol receipt is not such a change; do not echo it as a progress message. Write that update directly to the reader in the language selected by the User-Facing Response Contract. Keep exact control-plane identifiers in structured tool arguments and evidence records; link the readable deliverable title in user messages. Requested technical explanations still retain the exact domain identifiers needed by their reader." : ""
30060
30122
  ].filter(Boolean).join("\n");
30061
30123
  }
30062
30124
  function continuationPostconditionGapSection(context, input) {
@@ -33709,7 +33771,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
33709
33771
  }
33710
33772
 
33711
33773
  // src/amaster-runtime-daemon.mjs
33712
- var CONNECTOR_VERSION = "0.1.1-beta.287";
33774
+ var CONNECTOR_VERSION = "0.1.1-beta.289";
33713
33775
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
33714
33776
  var daemonRequire = createRequire(import.meta.url);
33715
33777
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -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.287";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.289";
11
11
 
12
12
  const CONFIG_KEY_MAP = new Map([
13
13
  ["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.1-beta.287",
3
+ "version": "0.1.1-beta.289",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",