@skrr-ai/cli 0.1.155 → 0.1.158

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 (150) hide show
  1. package/dist/base-command.js +64 -16
  2. package/dist/commands/activity/list.d.ts +13 -0
  3. package/dist/commands/activity/list.js +50 -0
  4. package/dist/commands/activity/scan-older.d.ts +23 -0
  5. package/dist/commands/activity/scan-older.js +74 -0
  6. package/dist/commands/activity/show.d.ts +27 -0
  7. package/dist/commands/activity/show.js +228 -0
  8. package/dist/commands/agent/message/send.js +64 -19
  9. package/dist/commands/agents/always-on/held-messages.js +24 -1
  10. package/dist/commands/agents/always-on/status.js +6 -1
  11. package/dist/commands/agents/mini-computer/app/reset.d.ts +13 -0
  12. package/dist/commands/agents/mini-computer/app/reset.js +35 -0
  13. package/dist/commands/agents/mini-computer/app/set.d.ts +16 -0
  14. package/dist/commands/agents/mini-computer/app/set.js +70 -0
  15. package/dist/commands/agents/mini-computer/layout/change.d.ts +14 -0
  16. package/dist/commands/agents/mini-computer/layout/change.js +44 -0
  17. package/dist/commands/agents/mini-computer/layout/folder.d.ts +14 -0
  18. package/dist/commands/agents/mini-computer/layout/folder.js +35 -0
  19. package/dist/commands/agents/mini-computer/layout/move.d.ts +14 -0
  20. package/dist/commands/agents/mini-computer/layout/move.js +32 -0
  21. package/dist/commands/agents/mini-computer/layout/pin.d.ts +14 -0
  22. package/dist/commands/agents/mini-computer/layout/pin.js +35 -0
  23. package/dist/commands/agents/mini-computer/layout/remove.d.ts +13 -0
  24. package/dist/commands/agents/mini-computer/layout/remove.js +27 -0
  25. package/dist/commands/agents/mini-computer/layout/restore.d.ts +13 -0
  26. package/dist/commands/agents/mini-computer/layout/restore.js +27 -0
  27. package/dist/commands/agents/mini-computer/layout/unfolder.d.ts +13 -0
  28. package/dist/commands/agents/mini-computer/layout/unfolder.js +27 -0
  29. package/dist/commands/agents/mini-computer/layout/unpin.d.ts +14 -0
  30. package/dist/commands/agents/mini-computer/layout/unpin.js +34 -0
  31. package/dist/commands/agents/mini-computer/show.d.ts +13 -0
  32. package/dist/commands/agents/mini-computer/show.js +60 -0
  33. package/dist/commands/agents/mini-computer/tasks-view.d.ts +29 -0
  34. package/dist/commands/agents/mini-computer/tasks-view.js +100 -0
  35. package/dist/commands/apps/auto-apply.d.ts +14 -0
  36. package/dist/commands/apps/auto-apply.js +53 -0
  37. package/dist/commands/apps/check.js +4 -1
  38. package/dist/commands/apps/create.js +11 -6
  39. package/dist/commands/apps/data/batch.d.ts +15 -0
  40. package/dist/commands/apps/data/batch.js +59 -0
  41. package/dist/commands/apps/data/collections.d.ts +12 -0
  42. package/dist/commands/apps/data/collections.js +44 -0
  43. package/dist/commands/apps/data/delete.d.ts +15 -0
  44. package/dist/commands/apps/data/delete.js +57 -0
  45. package/dist/commands/apps/data/patch.d.ts +17 -0
  46. package/dist/commands/apps/data/patch.js +70 -0
  47. package/dist/commands/apps/data/put.js +1 -1
  48. package/dist/commands/apps/data/query.js +1 -1
  49. package/dist/commands/apps/installations/diff.d.ts +14 -0
  50. package/dist/commands/apps/installations/diff.js +45 -0
  51. package/dist/commands/apps/installations/events.d.ts +23 -0
  52. package/dist/commands/apps/installations/events.js +104 -0
  53. package/dist/commands/apps/installations/snapshot.d.ts +18 -0
  54. package/dist/commands/apps/installations/snapshot.js +60 -0
  55. package/dist/commands/apps/installations/versions.d.ts +12 -0
  56. package/dist/commands/apps/installations/versions.js +38 -0
  57. package/dist/commands/apps/logs.js +3 -0
  58. package/dist/commands/apps/preview.js +4 -2
  59. package/dist/commands/apps/pull.js +10 -1
  60. package/dist/commands/apps/push.js +36 -12
  61. package/dist/commands/apps/reference.d.ts +26 -0
  62. package/dist/commands/apps/reference.js +56 -0
  63. package/dist/commands/apps/rollback.d.ts +13 -0
  64. package/dist/commands/apps/rollback.js +47 -0
  65. package/dist/commands/apps/version/create.js +5 -0
  66. package/dist/commands/duties/accounting.js +6 -0
  67. package/dist/commands/duties/analytics/detail.js +6 -0
  68. package/dist/commands/duties/analytics/index.js +14 -0
  69. package/dist/commands/duties/analytics/replay.js +6 -0
  70. package/dist/commands/duties/cost.js +6 -0
  71. package/dist/commands/duties/delete.js +22 -19
  72. package/dist/commands/duties/doctor.d.ts +2 -1
  73. package/dist/commands/duties/doctor.js +17 -3
  74. package/dist/commands/duties/goals/link.js +4 -0
  75. package/dist/commands/duties/goals/unlink.js +4 -0
  76. package/dist/commands/duties/lineage.js +6 -1
  77. package/dist/commands/duties/links/list.js +6 -0
  78. package/dist/commands/duties/metrics.js +10 -0
  79. package/dist/commands/duties/observations.js +12 -0
  80. package/dist/commands/duties/operating-review.d.ts +4 -30
  81. package/dist/commands/duties/operating-review.js +28 -141
  82. package/dist/commands/duties/receipt-metrics.js +7 -0
  83. package/dist/commands/duties/receipt.js +7 -0
  84. package/dist/commands/duties/roster.js +14 -8
  85. package/dist/commands/duties/show.js +27 -9
  86. package/dist/commands/duties/status.js +18 -9
  87. package/dist/commands/duties/trigger-status.d.ts +2 -0
  88. package/dist/commands/duties/trigger-status.js +19 -1
  89. package/dist/commands/duties/wake-capabilities.d.ts +2 -0
  90. package/dist/commands/duties/wake-capabilities.js +32 -2
  91. package/dist/commands/followups/act.js +3 -0
  92. package/dist/commands/followups/remind.js +12 -3
  93. package/dist/commands/followups/show.js +6 -0
  94. package/dist/commands/harnesses/quota.js +1 -1
  95. package/dist/commands/spaces/notebook.d.ts +3 -7
  96. package/dist/commands/spaces/notebook.js +32 -8
  97. package/dist/commands/tasks/create.d.ts +2 -2
  98. package/dist/commands/tasks/create.js +3 -3
  99. package/dist/commands/tasks/list.d.ts +3 -41
  100. package/dist/commands/tasks/list.js +5 -53
  101. package/dist/generated/agent-guides.json +424 -101
  102. package/dist/generated/managed-instruction-guides.json +1 -1
  103. package/dist/lib/agent-activity.d.ts +153 -0
  104. package/dist/lib/agent-activity.js +241 -0
  105. package/dist/lib/always-on-runtime.d.ts +9 -0
  106. package/dist/lib/always-on-runtime.js +20 -0
  107. package/dist/lib/api-fetch.d.ts +10 -0
  108. package/dist/lib/api-fetch.js +12 -2
  109. package/dist/lib/appData.d.ts +28 -1
  110. package/dist/lib/appData.js +111 -9
  111. package/dist/lib/appInstallations.d.ts +9 -1
  112. package/dist/lib/appInstallations.js +100 -0
  113. package/dist/lib/apps-command.d.ts +1 -0
  114. package/dist/lib/apps-command.js +11 -0
  115. package/dist/lib/apps.d.ts +12 -0
  116. package/dist/lib/apps.js +28 -1
  117. package/dist/lib/appsAssets.d.ts +17 -0
  118. package/dist/lib/appsAssets.js +15 -0
  119. package/dist/lib/appsCheck.d.ts +1 -0
  120. package/dist/lib/appsCheck.js +1 -0
  121. package/dist/lib/appsFs.d.ts +18 -1
  122. package/dist/lib/appsFs.js +76 -19
  123. package/dist/lib/compasses.js +6 -0
  124. package/dist/lib/duties.d.ts +25 -2
  125. package/dist/lib/duties.js +58 -3
  126. package/dist/lib/duty-analytics.d.ts +2 -0
  127. package/dist/lib/duty-analytics.js +26 -0
  128. package/dist/lib/duty-goal-propagation.d.ts +2 -0
  129. package/dist/lib/duty-goal-propagation.js +18 -0
  130. package/dist/lib/duty-history-source.d.ts +4 -0
  131. package/dist/lib/duty-history-source.js +12 -0
  132. package/dist/lib/duty-ledgers.d.ts +4 -0
  133. package/dist/lib/duty-ledgers.js +4 -0
  134. package/dist/lib/duty-receipt-source.d.ts +4 -0
  135. package/dist/lib/duty-receipt-source.js +19 -0
  136. package/dist/lib/followups.d.ts +20 -0
  137. package/dist/lib/followups.js +10 -0
  138. package/dist/lib/held-messages.d.ts +22 -0
  139. package/dist/lib/held-messages.js +55 -0
  140. package/dist/lib/list-workspace.d.ts +40 -0
  141. package/dist/lib/list-workspace.js +58 -0
  142. package/dist/lib/miniComputer.d.ts +59 -0
  143. package/dist/lib/miniComputer.js +224 -0
  144. package/dist/lib/miniComputerCommand.d.ts +13 -0
  145. package/dist/lib/miniComputerCommand.js +48 -0
  146. package/dist/lib/roles.d.ts +3 -3
  147. package/dist/lib/space-notebook.js +15 -4
  148. package/dist/node_modules/@skrr-ai/data-provider/index.js +10465 -8383
  149. package/oclif.manifest.json +2849 -462
  150. package/package.json +14 -2
@@ -5,18 +5,37 @@ const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const space_notebook_1 = require("../../lib/space-notebook");
7
7
  const web_url_1 = require("../../lib/web-url");
8
+ /** An older server can ignore the capability header and return unverified
9
+ * Duty history. Never render or emit it as JSON, regardless of server version.
10
+ */
11
+ function withholdUnverifiedDutyHistory(page) {
12
+ const withheld = new Set(['loop_cycle', 'hypothesis']);
13
+ // A legacy cursor may encode the position of a withheld row. It cannot be
14
+ // safely forwarded as if it were issued by an upgraded server.
15
+ const legacyCoverage = page.kinds.some((kind) => withheld.has(kind) &&
16
+ page.sources.find((source) => source.kind === kind)?.state !== 'unsupported');
17
+ const sources = page.sources
18
+ .filter((source) => !withheld.has(source.kind));
19
+ for (const kind of page.kinds) {
20
+ if (kind === 'loop_cycle' || kind === 'hypothesis') {
21
+ sources.push({ kind, state: 'unsupported' });
22
+ }
23
+ }
24
+ return {
25
+ ...page,
26
+ rows: page.rows.filter((row) => !withheld.has(row.kind)),
27
+ sources,
28
+ ...(legacyCoverage ? { nextCursor: null } : {}),
29
+ };
30
+ }
8
31
  /**
9
32
  * `skrr spaces notebook <space>` — the Space's notebook (OSK-17996): one page
10
- * of its Task Results, loop Cycles, hypothesis verdicts and journal / report
11
- * pages, newest first. A view over records that already exist: each row is a
12
- * summary and a link, and the body is read from the record itself. VIEW on
13
- * the Space. A loop's Cycles are shared with the Space's members while its
14
- * rules hold; a Duty that only watches the Space, and every hypothesis
15
- * verdict, show only to people who can open the Duty. Each loop row says
16
- * which.
33
+ * of its Task Results and journal / report pages, newest first. Loop Cycles
34
+ * and hypothesis verdicts are unavailable until their historical physical
35
+ * sources can be verified. Each available row links to its source record.
17
36
  */
18
37
  class SpacesNotebook extends base_command_1.BaseCommand {
19
- static description = "Show a space's notebook: its task results, loop cycles, hypothesis verdicts and journal and report pages, newest first";
38
+ static description = "Show a space's notebook, including task results and journal and report pages; unverified Duty history is marked unavailable";
20
39
  static examples = [
21
40
  '<%= config.bin %> spaces notebook <space-id>',
22
41
  '<%= config.bin %> spaces notebook "Growth lab" --kinds task_result,hypothesis',
@@ -55,11 +74,16 @@ class SpacesNotebook extends base_command_1.BaseCommand {
55
74
  ...(kinds.kinds.length < data_provider_1.SPACE_NOTEBOOK_KINDS.length ? { kinds: kinds.kinds } : {}),
56
75
  ...(typeof flags.limit === 'number' ? { limit: flags.limit } : {}),
57
76
  ...(flags.cursor ? { cursor: flags.cursor } : {}),
77
+ }, {
78
+ // This CLI understands unsupported sources and will not describe them
79
+ // as an empty or complete history. Legacy clients do not send this.
80
+ headers: { 'X-Skrr-Notebook-Capabilities': 'unsupported-sources-v1' },
58
81
  });
59
82
  }
60
83
  catch (err) {
61
84
  this.handleApiError(err, { subject: `space ${args.id}` });
62
85
  }
86
+ page = withholdUnverifiedDutyHistory(page);
63
87
  if (flags.json) {
64
88
  this.printJsonResult(page);
65
89
  return;
@@ -1,7 +1,7 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  import { type TaskRecord } from '../../lib/tasks';
3
- import { resolveListWorkspace } from './list';
4
- import type { ListWorkspaceScope } from './list';
3
+ import { resolveListWorkspace } from '../../lib/list-workspace';
4
+ import type { ListWorkspaceScope } from '../../lib/list-workspace';
5
5
  /**
6
6
  * Whether the estimate we asked for survived the write. (S3 dogfood finding)
7
7
  *
@@ -13,7 +13,7 @@ const label_ref_1 = require("../../lib/label-ref");
13
13
  const prompt_1 = require("../../lib/prompt");
14
14
  const tasks_1 = require("../../lib/tasks");
15
15
  const task_instruction_offer_1 = require("../../lib/task-instruction-offer");
16
- const list_1 = require("./list");
16
+ const list_workspace_1 = require("../../lib/list-workspace");
17
17
  const web_url_1 = require("../../lib/web-url");
18
18
  const TASK_CREATE_MAY_HAVE_COMMITTED_RE = /fetch failed|socket hang up|timed? ?out/i;
19
19
  /**
@@ -144,7 +144,7 @@ function taskMatchesCreateIdentity(task, payload) {
144
144
  async function resolveCreateWorkspace(scoped, env, lookupDefault) {
145
145
  if (scoped)
146
146
  return undefined;
147
- const scope = await (0, list_1.resolveListWorkspace)({}, env, lookupDefault);
147
+ const scope = await (0, list_workspace_1.resolveListWorkspace)({}, env, lookupDefault);
148
148
  return scope?.source === 'default' ? scope : undefined;
149
149
  }
150
150
  class TasksCreate extends base_command_1.BaseCommand {
@@ -366,7 +366,7 @@ class TasksCreate extends base_command_1.BaseCommand {
366
366
  body.projectId ||
367
367
  body.parentId ||
368
368
  body.goalId);
369
- const defaultWorkspace = await resolveCreateWorkspace(namesAScope, process.env, list_1.lookupDefaultWorkspace);
369
+ const defaultWorkspace = await resolveCreateWorkspace(namesAScope, process.env, list_workspace_1.lookupDefaultWorkspace);
370
370
  if (defaultWorkspace) {
371
371
  process.env.OVERSKY_WORKSPACE_ID = defaultWorkspace.workspaceId;
372
372
  if (!flags.json && defaultWorkspace.workspaceCount > 1) {
@@ -1,47 +1,10 @@
1
1
  import type { TaskListParams } from '@skrr-ai/data-provider';
2
2
  import { BaseCommand } from '../../base-command';
3
3
  import { type ListWarning } from '../../lib/list-output';
4
+ import { lookupDefaultWorkspace, resolveListWorkspace } from '../../lib/list-workspace';
5
+ export { lookupDefaultWorkspace, resolveListWorkspace };
6
+ export type { ListWorkspaceScope } from '../../lib/list-workspace';
4
7
  type ListFlags = Record<string, unknown>;
5
- /** Which workspace a list reads, and why (OSK-21284). */
6
- export type ListWorkspaceScope = {
7
- source: 'all';
8
- } | {
9
- source: 'default';
10
- workspaceId: string;
11
- workspaceName?: string;
12
- workspaceCount: number;
13
- };
14
- /**
15
- * A plain `tasks list` named no workspace, and the server answers that with a list across EVERY
16
- * workspace the person belongs to. Its access filter has branches that belong to no single
17
- * workspace, so no index can serve it in order: on production it timed out after about 6 s while
18
- * the same list naming a workspace answered in about a second. `skrr workspaces list` already says
19
- * an unselected session "resolves to your default workspace"; a list now reads it too.
20
- *
21
- * --all-workspaces the old, wider list, asked for by name (`workspaceScope=all`)
22
- * a selected workspace, `--workspace`, or `skrr workspaces use` untouched: the choice stands
23
- * an autonomous Agent session untouched: a workspace-less Agent session stays personal
24
- * `--space`, `--calendar` untouched: a Space names its own scope
25
- *
26
- * Returns nothing when there is nothing to apply, and `source: 'default'` when the caller's
27
- * default workspace should be used. `lookupDefault` is injected so the rule is tested without the
28
- * network; a lookup that fails or finds no default changes nothing.
29
- */
30
- export declare function resolveListWorkspace(flags: {
31
- 'all-workspaces'?: boolean;
32
- space?: string;
33
- calendar?: string;
34
- }, env: NodeJS.ProcessEnv, lookupDefault: () => Promise<{
35
- id: string;
36
- name?: string;
37
- count: number;
38
- } | null>): Promise<ListWorkspaceScope | undefined>;
39
- /** The default workspace the signed-in person's `skrr workspaces list` reports. */
40
- export declare function lookupDefaultWorkspace(): Promise<{
41
- id: string;
42
- name?: string;
43
- count: number;
44
- } | null>;
45
8
  /**
46
9
  * E12: inside an agent session an unfiltered `tasks list --json` returned the
47
10
  * first page of EVERYTHING, which in practice was cancelled test tasks. When the
@@ -190,4 +153,3 @@ export default class TasksList extends BaseCommand {
190
153
  };
191
154
  run(): Promise<void>;
192
155
  }
193
- export {};
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveListWorkspace = resolveListWorkspace;
4
- exports.lookupDefaultWorkspace = lookupDefaultWorkspace;
3
+ exports.resolveListWorkspace = exports.lookupDefaultWorkspace = void 0;
5
4
  exports.agentSessionOpenDefault = agentSessionOpenDefault;
6
5
  exports.emptyTasksMessage = emptyTasksMessage;
7
6
  exports.externalKeyPrefixWarnings = externalKeyPrefixWarnings;
@@ -22,7 +21,9 @@ const web_url_1 = require("../../lib/web-url");
22
21
  const format_1 = require("../../lib/format");
23
22
  const list_output_1 = require("../../lib/list-output");
24
23
  const tasks_1 = require("../../lib/tasks");
25
- const workspaces_1 = require("../../lib/workspaces");
24
+ const list_workspace_1 = require("../../lib/list-workspace");
25
+ Object.defineProperty(exports, "lookupDefaultWorkspace", { enumerable: true, get: function () { return list_workspace_1.lookupDefaultWorkspace; } });
26
+ Object.defineProperty(exports, "resolveListWorkspace", { enumerable: true, get: function () { return list_workspace_1.resolveListWorkspace; } });
26
27
  const task_economics_1 = require("../../lib/task-economics");
27
28
  const task_calendar_1 = require("../../lib/task-calendar");
28
29
  /**
@@ -69,55 +70,6 @@ const FILTER_FLAGS = new Set([
69
70
  'q',
70
71
  'view',
71
72
  ]);
72
- /**
73
- * A plain `tasks list` named no workspace, and the server answers that with a list across EVERY
74
- * workspace the person belongs to. Its access filter has branches that belong to no single
75
- * workspace, so no index can serve it in order: on production it timed out after about 6 s while
76
- * the same list naming a workspace answered in about a second. `skrr workspaces list` already says
77
- * an unselected session "resolves to your default workspace"; a list now reads it too.
78
- *
79
- * --all-workspaces the old, wider list, asked for by name (`workspaceScope=all`)
80
- * a selected workspace, `--workspace`, or `skrr workspaces use` untouched: the choice stands
81
- * an autonomous Agent session untouched: a workspace-less Agent session stays personal
82
- * `--space`, `--calendar` untouched: a Space names its own scope
83
- *
84
- * Returns nothing when there is nothing to apply, and `source: 'default'` when the caller's
85
- * default workspace should be used. `lookupDefault` is injected so the rule is tested without the
86
- * network; a lookup that fails or finds no default changes nothing.
87
- */
88
- async function resolveListWorkspace(flags, env, lookupDefault) {
89
- if (flags['all-workspaces'])
90
- return { source: 'all' };
91
- if (env.OVERSKY_WORKSPACE_ID?.trim())
92
- return undefined;
93
- if (env.OVERSKY_AUTONOMOUS_SESSION === '1')
94
- return undefined;
95
- if (flags.space || flags.calendar)
96
- return undefined;
97
- let found = null;
98
- try {
99
- found = await lookupDefault();
100
- }
101
- catch {
102
- return undefined;
103
- }
104
- if (!found?.id)
105
- return undefined;
106
- return {
107
- source: 'default',
108
- workspaceId: found.id,
109
- ...(found.name ? { workspaceName: found.name } : {}),
110
- workspaceCount: found.count,
111
- };
112
- }
113
- /** The default workspace the signed-in person's `skrr workspaces list` reports. */
114
- async function lookupDefaultWorkspace() {
115
- const listing = await (0, workspaces_1.listWorkspaceListing)();
116
- if (!listing.defaultWorkspaceId)
117
- return null;
118
- const row = listing.rows.find((entry) => entry.id === listing.defaultWorkspaceId);
119
- return { id: listing.defaultWorkspaceId, ...(row?.name ? { name: row.name } : {}), count: listing.rows.length };
120
- }
121
73
  /**
122
74
  * E12: inside an agent session an unfiltered `tasks list --json` returned the
123
75
  * first page of EVERYTHING, which in practice was cancelled test tasks. When the
@@ -737,7 +689,7 @@ class TasksList extends base_command_1.BaseCommand {
737
689
  flags.open = true;
738
690
  // Which workspace this list reads. A default is applied the way `--workspace` is: the
739
691
  // request header follows OVERSKY_WORKSPACE_ID, set for this process only.
740
- const workspaceScope = await resolveListWorkspace(flags, process.env, lookupDefaultWorkspace);
692
+ const workspaceScope = await (0, list_workspace_1.resolveListWorkspace)(flags, process.env, list_workspace_1.lookupDefaultWorkspace);
741
693
  if (workspaceScope?.source === 'default') {
742
694
  process.env.OVERSKY_WORKSPACE_ID = workspaceScope.workspaceId;
743
695
  if (!flags.json && !flags.ndjson && workspaceScope.workspaceCount > 1) {