@skrr-ai/cli 0.1.212 → 0.1.214

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.
Files changed (29) hide show
  1. package/dist/commands/agents/relationship/clear.d.ts +12 -0
  2. package/dist/commands/agents/relationship/clear.js +26 -0
  3. package/dist/commands/agents/relationship/edit.d.ts +15 -0
  4. package/dist/commands/agents/relationship/edit.js +40 -0
  5. package/dist/commands/agents/relationship/show.d.ts +12 -0
  6. package/dist/commands/agents/relationship/show.js +35 -0
  7. package/dist/commands/duties/action-proposal.js +2 -1
  8. package/dist/commands/duties/action-proposals.d.ts +1 -0
  9. package/dist/commands/duties/action-proposals.js +8 -0
  10. package/dist/lib/duties.js +4 -2
  11. package/dist/lib/inbound-messages.js +7 -0
  12. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.d.ts +21 -3
  13. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.js +20 -5
  14. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/personAskWindow.d.ts +23 -0
  15. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/personAskWindow.js +28 -0
  16. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +41 -2
  17. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +282 -9
  18. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/runtime.d.ts +5 -0
  19. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.d.ts +21 -3
  20. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.js +26 -10
  21. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/personAskWindow.d.ts +23 -0
  22. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/personAskWindow.js +23 -0
  23. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +41 -2
  24. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +460 -18
  25. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/runtime.d.ts +5 -0
  26. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  27. package/dist/node_modules/@skrr-ai/data-provider/index.js +10735 -10724
  28. package/oclif.manifest.json +241 -1
  29. package/package.json +2 -2
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class AgentsRelationshipClear extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ class AgentsRelationshipClear extends base_command_1.BaseCommand {
7
+ static description = "Clear this agent's relationship context. The continuity Duty writes a fresh one after the next material change in the conversation.";
8
+ static examples = ['<%= config.bin %> agents relationship clear <agent-id>'];
9
+ static args = { agentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ static flags = { json: core_1.Flags.boolean({ description: 'Output JSON' }) };
11
+ async run() {
12
+ this.requireAuth();
13
+ const { args, flags } = await this.parse(AgentsRelationshipClear);
14
+ let result;
15
+ try {
16
+ result = await data_provider_1.dataService.clearAgentRelationshipContext(args.agentId);
17
+ }
18
+ catch (err) {
19
+ this.handleApiError(err);
20
+ }
21
+ if (flags.json)
22
+ return this.log(this.agentJson(args.agentId, result));
23
+ this.log(`Agent ${args.agentId}: relationship context cleared`);
24
+ }
25
+ }
26
+ exports.default = AgentsRelationshipClear;
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class AgentsRelationshipEdit extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ summary: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ focus: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ question: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ class AgentsRelationshipEdit extends base_command_1.BaseCommand {
7
+ static description = "Replace this agent's relationship context with what you give here. The whole projection is replaced, so pass every focus and question you want kept.";
8
+ static examples = [
9
+ '<%= config.bin %> agents relationship edit <agent-id> --summary "Alert on unconfirmed developing stories too" --focus "NVDA export controls"',
10
+ ];
11
+ static args = { agentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
12
+ static flags = {
13
+ summary: core_1.Flags.string({ description: 'What the agent should understand about the work now' }),
14
+ focus: core_1.Flags.string({ description: 'A current focus (repeatable)', multiple: true }),
15
+ question: core_1.Flags.string({ description: 'An open question (repeatable)', multiple: true }),
16
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
17
+ };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args, flags } = await this.parse(AgentsRelationshipEdit);
21
+ if (!flags.summary && !flags.focus?.length && !flags.question?.length) {
22
+ this.error('Give --summary, --focus or --question; use `relationship clear` to remove it.');
23
+ }
24
+ let result;
25
+ try {
26
+ result = await data_provider_1.dataService.setAgentRelationshipContext(args.agentId, {
27
+ summary: flags.summary,
28
+ currentFocus: flags.focus,
29
+ openQuestions: flags.question,
30
+ });
31
+ }
32
+ catch (err) {
33
+ this.handleApiError(err);
34
+ }
35
+ if (flags.json)
36
+ return this.log(this.agentJson(args.agentId, result));
37
+ this.log(`Agent ${args.agentId}: relationship context replaced`);
38
+ }
39
+ }
40
+ exports.default = AgentsRelationshipEdit;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class AgentsRelationshipShow extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ class AgentsRelationshipShow extends base_command_1.BaseCommand {
7
+ static description = "Show the relationship context every Duty turn of this agent is given: a bounded summary kept by the agent's conversation continuity Duty. It can be older than the Duty's own directive; the directive wins where they disagree.";
8
+ static examples = ['<%= config.bin %> agents relationship show <agent-id>'];
9
+ static args = { agentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
10
+ static flags = { json: core_1.Flags.boolean({ description: 'Output JSON' }) };
11
+ async run() {
12
+ this.requireAuth();
13
+ const { args, flags } = await this.parse(AgentsRelationshipShow);
14
+ let result;
15
+ try {
16
+ result = await data_provider_1.dataService.getAgentRelationshipContext(args.agentId);
17
+ }
18
+ catch (err) {
19
+ this.handleApiError(err);
20
+ }
21
+ if (flags.json)
22
+ return this.log(this.agentJson(args.agentId, result));
23
+ const context = result.context;
24
+ if (!context)
25
+ return this.log('No relationship context is set.');
26
+ if (context.summary)
27
+ this.log(`Summary: ${context.summary}`);
28
+ for (const item of context.currentFocus ?? [])
29
+ this.log(`Focus: ${item}`);
30
+ for (const item of context.openQuestions ?? [])
31
+ this.log(`Open question: ${item}`);
32
+ this.log(`Updated: ${context.updatedAt ?? 'unknown'}${context.editedBy ? ` (edited by ${context.editedBy})` : ''}`);
33
+ }
34
+ }
35
+ exports.default = AgentsRelationshipShow;
@@ -4,6 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const base_command_1 = require("../../base-command");
5
5
  const duties_1 = require("../../lib/duties");
6
6
  const duty_history_source_1 = require("../../lib/duty-history-source");
7
+ const action_proposals_1 = require("./action-proposals");
7
8
  const ACTION_PROPOSAL_UNAVAILABLE = 'Action proposals are unavailable because their source cannot be verified.';
8
9
  /** Read the exact Action Bundle execution receipt before any retry. */
9
10
  class DutiesActionProposal extends base_command_1.BaseCommand {
@@ -37,7 +38,7 @@ class DutiesActionProposal extends base_command_1.BaseCommand {
37
38
  else {
38
39
  const proposal = result.proposal;
39
40
  const execution = result.execution;
40
- this.log(`Action Bundle: ${String(proposal?.status || 'unknown')}`);
41
+ this.log(`Action Bundle: ${proposal?.status ? (0, action_proposals_1.proposalStatusLabel)(proposal) : 'unknown'}`);
41
42
  this.log(`Operation: ${String(execution?.operationId || 'unavailable')}`);
42
43
  const receipt = execution?.receipt;
43
44
  this.log(`Receipt: ${String(receipt?.state || 'unknown')}`);
@@ -5,6 +5,7 @@ import { BaseCommand } from '../../base-command';
5
5
  */
6
6
  export declare function proposalStatusLabel(proposal: {
7
7
  status?: string;
8
+ voidedBy?: string;
8
9
  executionReceipt?: Record<string, unknown>;
9
10
  }): string;
10
11
  export default class DutiesActionProposals extends BaseCommand {
@@ -6,11 +6,19 @@ const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../base-command");
7
7
  const duties_1 = require("../../lib/duties");
8
8
  const format_1 = require("../../lib/format");
9
+ /** Why a held bundle the Duty no longer accepts can never be approved or run (`voidedBy`, OSK-33415). */
10
+ const VOIDED_BY_LABEL = {
11
+ duty_not_active: 'void: Duty not active',
12
+ duty_version_changed: 'void: Duty changed since',
13
+ };
9
14
  /**
10
15
  * An approved bundle waiting out the owner's quiet hours reads as held, with
11
16
  * the instant it sends, never as a bare `approved` that looks stuck.
12
17
  */
13
18
  function proposalStatusLabel(proposal) {
19
+ if (proposal.voidedBy && (proposal.status === 'proposed' || proposal.status === 'approved')) {
20
+ return VOIDED_BY_LABEL[proposal.voidedBy] || `void: ${proposal.voidedBy}`;
21
+ }
14
22
  const hold = proposal.executionReceipt?.hold;
15
23
  if (proposal.status === 'approved' && hold?.until) {
16
24
  return `held until ${hold.untilLabel || hold.until}`;
@@ -2768,7 +2768,8 @@ function renderDutyCases(response, log, options = {}) {
2768
2768
  id: text(item.id),
2769
2769
  status: text(item.status),
2770
2770
  severity: text(item.severity),
2771
- subject: text(firstValue(item, ['subjectKey', 'kind']), ''),
2771
+ // A Case's subject in words when the server could read one (OSK-33346); its key otherwise.
2772
+ subject: text(firstValue(item, ['subjectTitle', 'subjectKey', 'kind']), ''),
2772
2773
  facts: text(item.factCount, '0'),
2773
2774
  hypotheses: text(item.hypothesisCount, '0'),
2774
2775
  receipts: text(item.receiptCount, '0'),
@@ -2802,7 +2803,8 @@ function renderDutyCaseDetail(response, log, options = {}) {
2802
2803
  }
2803
2804
  const maxEntries = options.maxEntries ?? 10;
2804
2805
  log(`Case: ${text(data.id)} (${text(data.status)})`);
2805
- log(`Subject: ${text(data.subjectKey, '-')} · kind ${text(data.kind, '-')}`);
2806
+ const subjectTitle = text(data.subjectTitle, '');
2807
+ log(`Subject: ${subjectTitle ? `${subjectTitle} (${text(data.subjectKey, '-')})` : text(data.subjectKey, '-')} · kind ${text(data.kind, '-')}`);
2806
2808
  log(`Severity: ${text(data.severity, '-')} · revision ${text(data.caseRevision, '-')} · epoch ${text(data.activeEpoch, '-')}`);
2807
2809
  log(`Detected: ${text(data.firstDetectedAt, '-')} · last observed ${text(data.lastObservedAt, '-')}`);
2808
2810
  log(`Contents: ${text(data.factCount, '0')} facts · ${text(data.hypothesisCount, '0')} hypotheses · ${text(data.actionCount, '0')} actions · ${text(data.receiptCount, '0')} receipts`);
@@ -52,6 +52,13 @@ exports.HELD_COPY = {
52
52
  : 'Your agent is in a long step. It will see this when the step ends.',
53
53
  glance_unavailable: () => 'Your agent will see this at its next step.',
54
54
  queue_paused: () => 'Paused. This sends when you resume.',
55
+ last_reply_unconfirmed: (d) => {
56
+ const until = (0, data_provider_1.messageHeldUntil)({ detail: d });
57
+ const waits = "Waiting for your agent's last reply to be confirmed, so nothing is done twice.";
58
+ return until
59
+ ? `${waits} Sends by itself by ${until.toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit' })}.`
60
+ : `${waits} Sends by itself.`;
61
+ },
55
62
  };
56
63
  exports.FAILED_COPY = {
57
64
  agent_unavailable: 'Not delivered: this agent is no longer available.',
@@ -10,9 +10,23 @@ export declare const MANAGED_WORK_ACP_CAPABILITY: {
10
10
  export declare const MANAGED_WORK_ACP_MANAGER = "managed_work_acp_manager_v1";
11
11
  export declare const MANAGED_WORK_ACP_WORKER = "managed_work_acp_worker_v1";
12
12
  export declare const MANAGED_WORK_ACP_RECORDS = "managed_work_acp_task_records_v1";
13
+ /**
14
+ * The interaction roles in which the model is offered NO tool and answers once: a Task coordinator
15
+ * turn (`task_coordinator`) and a glance at a message beside running work (`chat_glance`). Neither
16
+ * is implied by the manager profile an adapter enforces, so each adapter names the ones it runs
17
+ * (`answerOnlyRoles`). An adapter that does not name a role is refused it by the server and by the
18
+ * daemon, and the caller falls back: a coordinator to the platform's template, a glance to a cloud
19
+ * reply when its owner allowed one, otherwise the message is held until the work ends.
20
+ *
21
+ * The first-party ACP engine names none. Its manager profile is a closed role enum, which in
22
+ * 0.1.0-rc.13 is `main_manager`, `task_reporter` and `task_discussion`, so it rejects both of these
23
+ * before its model runs. Add a role here only with an engine release whose enum holds it.
24
+ */
25
+ export declare const MANAGED_WORK_ANSWER_ONLY_ROLES: readonly ["task_coordinator", "chat_glance"];
26
+ export type ManagedWorkAnswerOnlyRole = (typeof MANAGED_WORK_ANSWER_ONLY_ROLES)[number];
13
27
  export declare function managedWorkAdapter(provider: unknown): {
14
28
  readonly engine: "sdk";
15
- readonly taskCoordinator: true;
29
+ readonly answerOnlyRoles: readonly ["task_coordinator", "chat_glance"];
16
30
  readonly manager: readonly ["native_interaction_profiles_v1", "sdk_pre_tool_use_exact_allowlist"];
17
31
  readonly worker: readonly ["native_task_work_controls_v1", "sdk_pre_tool_use_task_work_controls"];
18
32
  readonly taskRecords: readonly ["native_task_record_applicability_v1", "sdk_pre_tool_use_task_record_applicability"];
@@ -24,7 +38,7 @@ export declare function managedWorkAdapter(provider: unknown): {
24
38
  readonly taskRecords: readonly ["managed_work_acp_task_records_v1", "acp_task_record_applicability"];
25
39
  } | {
26
40
  readonly engine: "app-server";
27
- readonly taskCoordinator: true;
41
+ readonly answerOnlyRoles: readonly ["task_coordinator", "chat_glance"];
28
42
  readonly freshSession: true;
29
43
  readonly toolTransport: "daemon_rpc";
30
44
  readonly manager: readonly ["managed_work_codex_manager_v1", "app_server_scoped_dynamic_tools"];
@@ -32,14 +46,18 @@ export declare function managedWorkAdapter(provider: unknown): {
32
46
  readonly taskRecords: readonly ["managed_work_codex_task_records_v1", "app_server_canonical_task_records"];
33
47
  } | {
34
48
  readonly engine: "rpc";
35
- readonly taskCoordinator: true;
49
+ readonly answerOnlyRoles: readonly ["task_coordinator", "chat_glance"];
36
50
  readonly freshSession: true;
37
51
  readonly toolTransport: "daemon_rpc";
38
52
  readonly manager: readonly ["managed_work_pi_manager_v1", "pi_rpc_exact_tool_scope"];
39
53
  readonly worker: readonly ["managed_work_pi_worker_v1", "pi_rpc_governed_work_tools"];
40
54
  readonly taskRecords: readonly ["managed_work_pi_task_records_v1", "pi_rpc_canonical_task_records"];
41
55
  } | undefined;
56
+ /** Whether this harness can run `role`, one of the answer-only roles, with no tool offered to its model. */
57
+ export declare function managedWorkSupportsAnswerOnlyRole(provider: unknown, role: unknown): boolean;
42
58
  /** Whether this harness can run a Task coordinator turn with no tool offered to its model. */
43
59
  export declare function managedWorkSupportsTaskCoordinator(provider: unknown): boolean;
60
+ /** Whether this harness can run a glance (`chat_glance`) with no tool offered to its model. */
61
+ export declare function managedWorkSupportsChatGlance(provider: unknown): boolean;
44
62
  export declare function managedWorkCapabilities(provider: string): string[];
45
63
  export declare function advertisesManagedWorkAcp(value: unknown, worker: boolean, records: boolean): boolean;
@@ -23,9 +23,12 @@ __export(managedWorkRuntime_exports, {
23
23
  MANAGED_WORK_ACP_META: () => MANAGED_WORK_ACP_META,
24
24
  MANAGED_WORK_ACP_RECORDS: () => MANAGED_WORK_ACP_RECORDS,
25
25
  MANAGED_WORK_ACP_WORKER: () => MANAGED_WORK_ACP_WORKER,
26
+ MANAGED_WORK_ANSWER_ONLY_ROLES: () => MANAGED_WORK_ANSWER_ONLY_ROLES,
26
27
  advertisesManagedWorkAcp: () => advertisesManagedWorkAcp,
27
28
  managedWorkAdapter: () => managedWorkAdapter,
28
29
  managedWorkCapabilities: () => managedWorkCapabilities,
30
+ managedWorkSupportsAnswerOnlyRole: () => managedWorkSupportsAnswerOnlyRole,
31
+ managedWorkSupportsChatGlance: () => managedWorkSupportsChatGlance,
29
32
  managedWorkSupportsTaskCoordinator: () => managedWorkSupportsTaskCoordinator
30
33
  });
31
34
  module.exports = __toCommonJS(managedWorkRuntime_exports);
@@ -40,10 +43,11 @@ const MANAGED_WORK_ACP_CAPABILITY = {
40
43
  const MANAGED_WORK_ACP_MANAGER = "managed_work_acp_manager_v1";
41
44
  const MANAGED_WORK_ACP_WORKER = "managed_work_acp_worker_v1";
42
45
  const MANAGED_WORK_ACP_RECORDS = "managed_work_acp_task_records_v1";
46
+ const MANAGED_WORK_ANSWER_ONLY_ROLES = ["task_coordinator", "chat_glance"];
43
47
  const adapters = {
44
48
  claude: {
45
49
  engine: "sdk",
46
- taskCoordinator: true,
50
+ answerOnlyRoles: MANAGED_WORK_ANSWER_ONLY_ROLES,
47
51
  manager: ["native_interaction_profiles_v1", "sdk_pre_tool_use_exact_allowlist"],
48
52
  worker: ["native_task_work_controls_v1", "sdk_pre_tool_use_task_work_controls"],
49
53
  taskRecords: [
@@ -60,7 +64,7 @@ const adapters = {
60
64
  },
61
65
  codex: {
62
66
  engine: "app-server",
63
- taskCoordinator: true,
67
+ answerOnlyRoles: MANAGED_WORK_ANSWER_ONLY_ROLES,
64
68
  freshSession: true,
65
69
  toolTransport: "daemon_rpc",
66
70
  manager: ["managed_work_codex_manager_v1", "app_server_scoped_dynamic_tools"],
@@ -69,7 +73,7 @@ const adapters = {
69
73
  },
70
74
  pi: {
71
75
  engine: "rpc",
72
- taskCoordinator: true,
76
+ answerOnlyRoles: MANAGED_WORK_ANSWER_ONLY_ROLES,
73
77
  freshSession: true,
74
78
  toolTransport: "daemon_rpc",
75
79
  manager: ["managed_work_pi_manager_v1", "pi_rpc_exact_tool_scope"],
@@ -83,9 +87,17 @@ function managedWorkAdapter(provider) {
83
87
  const name = ["claude-code", "claude_code", "local-claude-code"].includes(provider) ? "claude" : (0, import_firstPartyHarness.canonicalHarnessProvider)(provider);
84
88
  return Object.hasOwn(adapters, name) ? adapters[name] : void 0;
85
89
  }
86
- function managedWorkSupportsTaskCoordinator(provider) {
90
+ function managedWorkSupportsAnswerOnlyRole(provider, role) {
87
91
  const adapter = managedWorkAdapter(provider);
88
- return Boolean(adapter && "taskCoordinator" in adapter);
92
+ if (!adapter || !("answerOnlyRoles" in adapter))
93
+ return false;
94
+ return adapter.answerOnlyRoles.includes(role);
95
+ }
96
+ function managedWorkSupportsTaskCoordinator(provider) {
97
+ return managedWorkSupportsAnswerOnlyRole(provider, "task_coordinator");
98
+ }
99
+ function managedWorkSupportsChatGlance(provider) {
100
+ return managedWorkSupportsAnswerOnlyRole(provider, "chat_glance");
89
101
  }
90
102
  function managedWorkCapabilities(provider) {
91
103
  const adapter = managedWorkAdapter(provider);
@@ -104,8 +116,11 @@ function advertisesManagedWorkAcp(value, worker, records) {
104
116
  MANAGED_WORK_ACP_META,
105
117
  MANAGED_WORK_ACP_RECORDS,
106
118
  MANAGED_WORK_ACP_WORKER,
119
+ MANAGED_WORK_ANSWER_ONLY_ROLES,
107
120
  advertisesManagedWorkAcp,
108
121
  managedWorkAdapter,
109
122
  managedWorkCapabilities,
123
+ managedWorkSupportsAnswerOnlyRole,
124
+ managedWorkSupportsChatGlance,
110
125
  managedWorkSupportsTaskCoordinator
111
126
  });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * How long an agent's question or approval waits for its person (OSK-33439).
3
+ *
4
+ * ONE number for every place an agent asks a person and waits: a cloud turn's
5
+ * approval and question (the API's `AgentWorker/permissionWindow.js`) and a
6
+ * session that runs natively on the person's machine (the daemon's permissions
7
+ * bridge, `DEFAULT_PERMISSION_TIMEOUT_MS`). Before this the daemon kept its own
8
+ * copy, five minutes, under a comment saying it matched the server. The server
9
+ * had moved to ten minutes on 2026-10-22, so the same person got ten minutes when
10
+ * the agent ran in the cloud and five when it ran on their machine, and nothing
11
+ * on screen said why.
12
+ *
13
+ * Why ten minutes (owner decision 2026-10-22): answers arrive in under a second
14
+ * when someone is there, so the window is for a person who stepped away, and an
15
+ * open ask keeps its turn's spend reserved for as long as it waits. A 72-hour
16
+ * window once left three abandoned cards holding $9.9 of a $10 balance
17
+ * (OSK-17926). Expiry is an answer the run finishes with, not an error.
18
+ *
19
+ * A harness whose own runtime gives up on an ask sooner keeps that shorter bound,
20
+ * because a card that outlives the wait behind it would take an answer nothing
21
+ * reads (the daemon's ACP permission authority, `acp-permission/authority.ts`).
22
+ */
23
+ export declare const PERSON_ASK_WINDOW_MS: number;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var personAskWindow_exports = {};
20
+ __export(personAskWindow_exports, {
21
+ PERSON_ASK_WINDOW_MS: () => PERSON_ASK_WINDOW_MS
22
+ });
23
+ module.exports = __toCommonJS(personAskWindow_exports);
24
+ const PERSON_ASK_WINDOW_MS = 10 * 60 * 1e3;
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ PERSON_ASK_WINDOW_MS
28
+ });
@@ -1,4 +1,42 @@
1
+ import fs from 'node:fs';
1
2
  import { type ReauthState, type TokenPair } from './types.js';
3
+ interface PendingLockFsCall {
4
+ op: string;
5
+ path?: string;
6
+ startedAt: number;
7
+ }
8
+ interface LockAcquireState {
9
+ /** Callback-style calls proper-lockfile made whose callback has not run. */
10
+ pending: Set<PendingLockFsCall>;
11
+ /** Set when the deadline passes; from then on it makes no file-system call. */
12
+ abandoned: boolean;
13
+ /**
14
+ * mkdir calls of the lock directory: one per retry attempt, plus one more
15
+ * inside an attempt after a stale takeover or a stat that found no directory.
16
+ */
17
+ mkdirCalls: number;
18
+ /** When it started, which is when its deadline started. */
19
+ startedAt: number;
20
+ }
21
+ export declare const __authLockTesting: {
22
+ acquireDeadlineMs: number;
23
+ asyncFsProbeMs: number;
24
+ /**
25
+ * The `fs` proper-lockfile uses: Node's own. Its default, graceful-fs 4.2,
26
+ * retries EMFILE only for open, readFile, writeFile, appendFile, copyFile and
27
+ * readdir, none of which it calls; for realpath, mkdir, stat, utimes and
28
+ * rmdir graceful-fs changes only how `stat` reports a negative uid or gid.
29
+ */
30
+ fs: typeof fs;
31
+ lockPaths: Map<string, {
32
+ blockers: Set<unknown>;
33
+ passedOver: Set<unknown>;
34
+ waiters: Set<unknown>;
35
+ }>;
36
+ probes: Map<string, unknown>;
37
+ /** The wrapper every proper-lockfile call goes through (`trackedLockFs`). */
38
+ trackFs(base: typeof fs, state: LockAcquireState, onPendingChange: () => void): typeof fs;
39
+ };
2
40
  declare function authLockPath(): string;
3
41
  declare function reauthFlagPath(): string;
4
42
  /**
@@ -89,8 +127,9 @@ export interface LockExitHandlerOptions {
89
127
  export declare function installLockExitHandlers(options?: LockExitHandlerOptions): void;
90
128
  /**
91
129
  * Acquire the cross-process auth lock, run the body, release on `finally`.
92
- * Throws if the lock can't be acquired within
93
- * `LOCK_MAX_RETRIES × LOCK_RETRY_MS`.
130
+ * Throws ELOCKED once proper-lockfile's retries are spent (about 19 s), and a
131
+ * `TransientAuthFailure` if the acquire is still pending at
132
+ * `LOCK_ACQUIRE_DEADLINE_MS` (OSK-33422).
94
133
  *
95
134
  * We lock a sentinel file (auth.lock) that we create/touch if missing —
96
135
  * locking the real auth.json would race with atomic-rename writes.