@skrr-ai/cli 0.1.206 → 0.1.208

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 (155) hide show
  1. package/dist/commands/agent/message/resolve.d.ts +31 -0
  2. package/dist/commands/agent/message/resolve.js +111 -0
  3. package/dist/commands/agent/message/send.d.ts +17 -5
  4. package/dist/commands/agent/message/send.js +77 -26
  5. package/dist/commands/agent/request/list.d.ts +15 -0
  6. package/dist/commands/agent/request/list.js +82 -0
  7. package/dist/commands/agent/request/send.d.ts +18 -0
  8. package/dist/commands/agent/request/send.js +56 -0
  9. package/dist/commands/agents/access/approve.d.ts +17 -0
  10. package/dist/commands/agents/access/approve.js +94 -0
  11. package/dist/commands/agents/access/deny.d.ts +10 -0
  12. package/dist/commands/agents/access/deny.js +36 -0
  13. package/dist/commands/agents/access/list.d.ts +10 -0
  14. package/dist/commands/agents/access/list.js +53 -0
  15. package/dist/commands/agents/access/reach.d.ts +13 -0
  16. package/dist/commands/agents/access/reach.js +53 -0
  17. package/dist/commands/agents/access/revoke.d.ts +13 -0
  18. package/dist/commands/agents/access/revoke.js +50 -0
  19. package/dist/commands/agents/import.d.ts +15 -1
  20. package/dist/commands/agents/import.js +211 -23
  21. package/dist/commands/agents/intuitions/accept.d.ts +0 -1
  22. package/dist/commands/agents/intuitions/accept.js +22 -7
  23. package/dist/commands/agents/intuitions/generate.d.ts +0 -1
  24. package/dist/commands/agents/intuitions/generate.js +4 -16
  25. package/dist/commands/agents/intuitions/list.js +9 -3
  26. package/dist/commands/agents/intuitions/resume.d.ts +11 -0
  27. package/dist/commands/agents/intuitions/resume.js +37 -0
  28. package/dist/commands/agents/models.d.ts +11 -0
  29. package/dist/commands/agents/models.js +51 -0
  30. package/dist/commands/agents/shared-memory.d.ts +24 -0
  31. package/dist/commands/agents/shared-memory.js +67 -0
  32. package/dist/commands/agents/visibility.d.ts +1 -0
  33. package/dist/commands/agents/visibility.js +14 -0
  34. package/dist/commands/balance/route-premiums.d.ts +9 -0
  35. package/dist/commands/balance/route-premiums.js +33 -0
  36. package/dist/commands/code/migrate.js +3 -1
  37. package/dist/commands/convos/transcript.d.ts +0 -1
  38. package/dist/commands/convos/transcript.js +0 -1
  39. package/dist/commands/duties/advance-next.js +15 -6
  40. package/dist/commands/followups/show.js +9 -0
  41. package/dist/commands/followups/watch-pr.d.ts +27 -0
  42. package/dist/commands/followups/watch-pr.js +123 -0
  43. package/dist/commands/goals/create.d.ts +1 -0
  44. package/dist/commands/goals/create.js +8 -0
  45. package/dist/commands/goals/creation-receipt.d.ts +10 -0
  46. package/dist/commands/goals/creation-receipt.js +43 -0
  47. package/dist/commands/goals/key-results/create.d.ts +2 -0
  48. package/dist/commands/goals/key-results/create.js +14 -0
  49. package/dist/commands/goals/key-results/creation-receipt.d.ts +13 -0
  50. package/dist/commands/goals/key-results/creation-receipt.js +51 -0
  51. package/dist/commands/harnesses/forget.d.ts +2 -0
  52. package/dist/commands/harnesses/forget.js +31 -0
  53. package/dist/commands/harnesses/removal-receipt.d.ts +11 -0
  54. package/dist/commands/harnesses/removal-receipt.js +32 -0
  55. package/dist/commands/harnesses/removal-review.d.ts +11 -0
  56. package/dist/commands/harnesses/removal-review.js +28 -0
  57. package/dist/commands/memory/consolidation/index.d.ts +20 -0
  58. package/dist/commands/memory/consolidation/index.js +78 -0
  59. package/dist/commands/memory/consolidation/resume.d.ts +14 -0
  60. package/dist/commands/memory/consolidation/resume.js +46 -0
  61. package/dist/commands/memory/consolidation/undo.d.ts +18 -0
  62. package/dist/commands/memory/consolidation/undo.js +60 -0
  63. package/dist/commands/slack/mutes.d.ts +10 -0
  64. package/dist/commands/slack/mutes.js +62 -0
  65. package/dist/commands/slack/unmute.d.ts +12 -0
  66. package/dist/commands/slack/unmute.js +44 -0
  67. package/dist/commands/spaces/loops/release-receipt.d.ts +14 -0
  68. package/dist/commands/spaces/loops/release-receipt.js +48 -0
  69. package/dist/commands/spaces/loops/release.js +1 -1
  70. package/dist/commands/spaces/workflow-templates/archive.d.ts +1 -0
  71. package/dist/commands/spaces/workflow-templates/archive.js +9 -1
  72. package/dist/commands/spaces/workflow-templates/show.js +2 -0
  73. package/dist/commands/spaces/workflow-templates/update.d.ts +1 -0
  74. package/dist/commands/spaces/workflow-templates/update.js +12 -1
  75. package/dist/commands/spaces/workflows/publish.d.ts +1 -0
  76. package/dist/commands/spaces/workflows/publish.js +41 -2
  77. package/dist/commands/tasks/actionability.js +9 -0
  78. package/dist/commands/tasks/ask.d.ts +50 -0
  79. package/dist/commands/tasks/ask.js +190 -0
  80. package/dist/commands/tasks/create.d.ts +2 -0
  81. package/dist/commands/tasks/create.js +19 -6
  82. package/dist/commands/tasks/creation-receipt.d.ts +12 -0
  83. package/dist/commands/tasks/creation-receipt.js +53 -0
  84. package/dist/commands/tasks/delete.d.ts +1 -0
  85. package/dist/commands/tasks/delete.js +22 -4
  86. package/dist/commands/tasks/deletion-receipt.d.ts +12 -0
  87. package/dist/commands/tasks/deletion-receipt.js +37 -0
  88. package/dist/commands/tasks/handover.js +14 -0
  89. package/dist/commands/tasks/input/answer.js +8 -2
  90. package/dist/commands/tasks/input/show.d.ts +26 -0
  91. package/dist/commands/tasks/input/show.js +185 -17
  92. package/dist/commands/tasks/move.d.ts +11 -0
  93. package/dist/commands/tasks/move.js +82 -1
  94. package/dist/commands/tasks/result/submit.js +3 -0
  95. package/dist/commands/tasks/runs.d.ts +4 -1
  96. package/dist/commands/tasks/runs.js +22 -3
  97. package/dist/commands/tasks/show.js +22 -1
  98. package/dist/commands/tasks/update.d.ts +1 -0
  99. package/dist/commands/tasks/update.js +52 -1
  100. package/dist/commands/tasks/updates/add.js +3 -0
  101. package/dist/commands/tasks/wait.d.ts +20 -0
  102. package/dist/commands/tasks/wait.js +102 -1
  103. package/dist/generated/agent-guides.json +501 -92
  104. package/dist/generated/managed-instruction-guides.json +1 -1
  105. package/dist/lib/agent-access-command.d.ts +19 -0
  106. package/dist/lib/agent-access-command.js +44 -0
  107. package/dist/lib/agent-access.d.ts +18 -0
  108. package/dist/lib/agent-access.js +48 -0
  109. package/dist/lib/agent-import/apply.d.ts +50 -0
  110. package/dist/lib/agent-import/apply.js +85 -0
  111. package/dist/lib/agent-import/plan.d.ts +132 -0
  112. package/dist/lib/agent-import/plan.js +504 -0
  113. package/dist/lib/agent-import/reader.d.ts +94 -0
  114. package/dist/lib/agent-import/reader.js +326 -0
  115. package/dist/lib/agent-import/schedule.d.ts +46 -0
  116. package/dist/lib/agent-import/schedule.js +220 -0
  117. package/dist/lib/agent-import/sources.d.ts +124 -0
  118. package/dist/lib/agent-import/sources.js +797 -0
  119. package/dist/lib/execution-target.d.ts +1 -1
  120. package/dist/lib/execution-target.js +4 -0
  121. package/dist/lib/followups.d.ts +61 -0
  122. package/dist/lib/followups.js +39 -0
  123. package/dist/lib/handover-interview.d.ts +18 -0
  124. package/dist/lib/handover-interview.js +53 -0
  125. package/dist/lib/harnesses.d.ts +25 -0
  126. package/dist/lib/harnesses.js +15 -0
  127. package/dist/lib/input-queue.js +2 -1
  128. package/dist/lib/intuition-look.d.ts +10 -0
  129. package/dist/lib/intuition-look.js +64 -0
  130. package/dist/lib/record-output.d.ts +1 -1
  131. package/dist/lib/record-output.js +2 -0
  132. package/dist/lib/request-uuid.d.ts +2 -0
  133. package/dist/lib/request-uuid.js +10 -0
  134. package/dist/lib/skill-import.d.ts +19 -0
  135. package/dist/lib/skill-import.js +34 -0
  136. package/dist/lib/slack-thread-mutes.d.ts +25 -0
  137. package/dist/lib/slack-thread-mutes.js +12 -0
  138. package/dist/lib/task-carriers.d.ts +18 -0
  139. package/dist/lib/task-carriers.js +43 -0
  140. package/dist/lib/task-extras.d.ts +5 -0
  141. package/dist/lib/task-extras.js +5 -0
  142. package/dist/lib/task-recurrence-summary.d.ts +15 -0
  143. package/dist/lib/task-recurrence-summary.js +22 -0
  144. package/dist/lib/task-version.d.ts +44 -0
  145. package/dist/lib/task-version.js +73 -0
  146. package/dist/lib/task-write-attribution.d.ts +7 -0
  147. package/dist/lib/task-write-attribution.js +14 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.d.ts +75 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/turnPacing.js +124 -0
  150. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.d.ts +75 -0
  151. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/turnPacing.js +141 -0
  152. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  153. package/dist/node_modules/@skrr-ai/data-provider/index.js +13350 -12579
  154. package/oclif.manifest.json +3044 -563
  155. package/package.json +5 -2
@@ -0,0 +1,36 @@
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 agent_access_command_1 = require("../../../lib/agent-access-command");
6
+ /** Decline an access request. The person cannot ask again for a week. */
7
+ class AgentsAccessDeny extends agent_access_command_1.AgentAccessCommand {
8
+ static description = 'Decline an access request';
9
+ static examples = [
10
+ '<%= config.bin %> agents access deny <request-id> --agent <agent-id>',
11
+ ];
12
+ static args = {
13
+ requestId: core_1.Args.string({ description: 'Access request id', required: true, ignoreStdin: true }),
14
+ };
15
+ async run() {
16
+ this.requireAuth();
17
+ const { args, flags } = await this.parse(AgentsAccessDeny);
18
+ const agentId = await this.accessAgentId(flags.agent);
19
+ let result;
20
+ try {
21
+ result = await data_provider_1.dataService.decideAgentAccessRequest(agentId, args.requestId, {
22
+ decision: 'deny',
23
+ });
24
+ }
25
+ catch (err) {
26
+ this.handleApiError(err);
27
+ }
28
+ if (flags.json) {
29
+ this.log(JSON.stringify(result, null, 2));
30
+ return;
31
+ }
32
+ const who = result.request?.requesterName || result.request?.platformUserId || 'They';
33
+ this.log(`Declined. ${who} stays restricted and cannot ask again for a week.`);
34
+ }
35
+ }
36
+ exports.default = AgentsAccessDeny;
@@ -0,0 +1,10 @@
1
+ import { AgentAccessCommand } from '../../../lib/agent-access-command';
2
+ /**
3
+ * Who may ask an agent for work in its channels: the people you trusted and
4
+ * what each may reach, and the requests waiting for you.
5
+ */
6
+ export default class AgentsAccessList extends AgentAccessCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const data_provider_1 = require("@skrr-ai/data-provider");
4
+ const agent_access_command_1 = require("../../../lib/agent-access-command");
5
+ const agent_access_1 = require("../../../lib/agent-access");
6
+ /**
7
+ * Who may ask an agent for work in its channels: the people you trusted and
8
+ * what each may reach, and the requests waiting for you.
9
+ */
10
+ class AgentsAccessList extends agent_access_command_1.AgentAccessCommand {
11
+ static description = 'List the people trusted to ask an agent for work in its channels, and pending access requests';
12
+ static examples = [
13
+ '<%= config.bin %> agents access list --agent <agent-id>',
14
+ '<%= config.bin %> agents access list --json',
15
+ ];
16
+ async run() {
17
+ this.requireAuth();
18
+ const { flags } = await this.parse(AgentsAccessList);
19
+ const agentId = await this.accessAgentId(flags.agent);
20
+ const access = await this.readAccess(agentId);
21
+ if (flags.json) {
22
+ this.log(JSON.stringify(access, null, 2));
23
+ return;
24
+ }
25
+ const pending = access.requests.filter((request) => request.state === 'pending');
26
+ const decided = access.requests.filter((request) => request.state !== 'pending');
27
+ this.log(`Agent: ${access.agentName || access.agentId}`);
28
+ this.log('');
29
+ this.log(`Waiting for you (${pending.length})`);
30
+ if (!pending.length) {
31
+ this.log(` None. Someone in the agent's channels can send "${data_provider_1.ACCESS_REQUEST_COMMAND}" to ask.`);
32
+ }
33
+ for (const request of pending)
34
+ this.log(` ${(0, agent_access_1.requestLine)(request)}`);
35
+ this.log('');
36
+ this.log(`Trusted (${access.trustedAskers.length})`);
37
+ if (!access.trustedAskers.length)
38
+ this.log(' Nobody yet. Everyone else is restricted.');
39
+ for (const asker of access.trustedAskers)
40
+ this.log(` ${(0, agent_access_1.trustedAskerLine)(asker)}`);
41
+ if (decided.length) {
42
+ this.log('');
43
+ this.log('Earlier requests');
44
+ for (const request of decided.slice(0, 10))
45
+ this.log(` ${(0, agent_access_1.requestLine)(request)}`);
46
+ }
47
+ if (pending.length) {
48
+ this.log('');
49
+ this.log(`Approve with \`${this.config.bin} agents access approve <request-id> --reach connected_apps,agent_tools\`, or decline with \`${this.config.bin} agents access deny <request-id>\`.`);
50
+ }
51
+ }
52
+ }
53
+ exports.default = AgentsAccessList;
@@ -0,0 +1,13 @@
1
+ import { AgentAccessCommand } from '../../../lib/agent-access-command';
2
+ /** Change what a trusted asker may reach. It applies from their next message. */
3
+ export default class AgentsAccessReach extends AgentAccessCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ askerId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ reach: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,53 @@
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 agent_access_command_1 = require("../../../lib/agent-access-command");
6
+ const agent_access_1 = require("../../../lib/agent-access");
7
+ /** Change what a trusted asker may reach. It applies from their next message. */
8
+ class AgentsAccessReach extends agent_access_command_1.AgentAccessCommand {
9
+ static description = 'Change what a trusted asker may reach through the agent';
10
+ static examples = [
11
+ '<%= config.bin %> agents access reach <asker-id> --reach agent_tools',
12
+ '<%= config.bin %> agents access reach <asker-id> --reach none',
13
+ ];
14
+ static args = {
15
+ askerId: core_1.Args.string({ description: 'Trusted asker id', required: true, ignoreStdin: true }),
16
+ };
17
+ static flags = {
18
+ reach: core_1.Flags.string({
19
+ multiple: true,
20
+ required: true,
21
+ description: `What they may reach: ${agent_access_1.TRUSTED_ASKER_REACH.join(', ')} (comma-separated), or none for conversation only`,
22
+ }),
23
+ };
24
+ async run() {
25
+ this.requireAuth();
26
+ const { args, flags } = await this.parse(AgentsAccessReach);
27
+ const { reach, unknown } = (0, agent_access_1.parseReachFlag)(flags.reach);
28
+ if (unknown.length) {
29
+ this.failWithCliError({
30
+ message: `Unknown reach: ${unknown.join(', ')}. Use ${agent_access_1.TRUSTED_ASKER_REACH.join(', ')} or none.`,
31
+ code: 'INVALID_REACH',
32
+ exit: 2,
33
+ retryable: false,
34
+ });
35
+ }
36
+ const agentId = await this.accessAgentId(flags.agent);
37
+ let result;
38
+ try {
39
+ result = await data_provider_1.dataService.updateAgentTrustedAsker(agentId, args.askerId, reach);
40
+ }
41
+ catch (err) {
42
+ this.handleApiError(err);
43
+ }
44
+ if (flags.json) {
45
+ this.log(JSON.stringify(result, null, 2));
46
+ return;
47
+ }
48
+ this.log(`Reach is now: ${(0, agent_access_1.reachSummary)(result.trustedAsker.reach)}`);
49
+ for (const line of (0, agent_access_1.confirmLines)(result.confirm))
50
+ this.log(line);
51
+ }
52
+ }
53
+ exports.default = AgentsAccessReach;
@@ -0,0 +1,13 @@
1
+ import { AgentAccessCommand } from '../../../lib/agent-access-command';
2
+ /** Revoke a trusted asker. Their next message is treated like anyone else's. */
3
+ export default class AgentsAccessRevoke extends AgentAccessCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ askerId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,50 @@
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 agent_access_command_1 = require("../../../lib/agent-access-command");
6
+ const prompt_1 = require("../../../lib/prompt");
7
+ /** Revoke a trusted asker. Their next message is treated like anyone else's. */
8
+ class AgentsAccessRevoke extends agent_access_command_1.AgentAccessCommand {
9
+ static description = 'Revoke a trusted asker; they are restricted from their next message';
10
+ static examples = ['<%= config.bin %> agents access revoke <asker-id> --yes'];
11
+ static args = {
12
+ askerId: core_1.Args.string({ description: 'Trusted asker id', required: true, ignoreStdin: true }),
13
+ };
14
+ static flags = {
15
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Revoke without asking to confirm' }),
16
+ };
17
+ async run() {
18
+ this.requireAuth();
19
+ const { args, flags } = await this.parse(AgentsAccessRevoke);
20
+ const agentId = await this.accessAgentId(flags.agent);
21
+ let ok = false;
22
+ try {
23
+ ok = await (0, prompt_1.confirmDestructive)(`Revoke trusted asker ${args.askerId}?`, Boolean(flags.yes));
24
+ }
25
+ catch (err) {
26
+ const e = err;
27
+ if (e.exit === 7)
28
+ this.error(e.message ?? 'Confirmation required.', { exit: 7 });
29
+ throw err;
30
+ }
31
+ if (!ok) {
32
+ this.log('Not revoked.');
33
+ return;
34
+ }
35
+ let result;
36
+ try {
37
+ result = await data_provider_1.dataService.revokeAgentTrustedAsker(agentId, args.askerId);
38
+ }
39
+ catch (err) {
40
+ this.handleApiError(err);
41
+ }
42
+ if (flags.json) {
43
+ this.log(JSON.stringify(result, null, 2));
44
+ return;
45
+ }
46
+ const who = result.trustedAsker?.displayName || result.trustedAsker?.platformUserId || 'They';
47
+ this.log(`Revoked. ${who} is restricted from their next message.`);
48
+ }
49
+ }
50
+ exports.default = AgentsAccessRevoke;
@@ -1,7 +1,9 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
3
  * Bring a Claude Code asset in: a subagent (`.claude/agents/<name>.md`) or a
4
- * skill (`SKILL.md`, or the directory holding one).
4
+ * skill (`SKILL.md`, or the directory holding one). Or bring a whole bot over
5
+ * from OpenClaw, Hermes or Orca: point it at the bot's folder (see
6
+ * `lib/agent-import/`), read the plan, and say yes.
5
7
  *
6
8
  * A subagent becomes an agent spec document — printed or written with
7
9
  * `--output`, or pushed onto an existing agent with `--agent` (the same push
@@ -23,6 +25,10 @@ export default class AgentsImport extends BaseCommand {
23
25
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
26
  output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
27
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
28
+ from: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
29
+ 'source-agent': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
30
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
31
+ 'replace-persona': import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
32
  };
27
33
  run(): Promise<void>;
28
34
  private convert;
@@ -34,4 +40,12 @@ export default class AgentsImport extends BaseCommand {
34
40
  */
35
41
  private importAgent;
36
42
  private importSkill;
43
+ /** A folder with no SKILL.md whose layout is an OpenClaw, Hermes or Orca bot's. */
44
+ private isBotFolder;
45
+ /**
46
+ * Bring a bot over from another app. Reads the folder (never a key file, never a secret-looking
47
+ * line, never a link out of it), shows the plan, and writes only after a yes: the prompt on a
48
+ * terminal, `--yes` anywhere else. Without `--agent` it shows the plan and writes nothing.
49
+ */
50
+ private importBot;
37
51
  }
@@ -9,9 +9,32 @@ const core_1 = require("@oclif/core");
9
9
  const data_provider_1 = require("@skrr-ai/data-provider");
10
10
  const base_command_1 = require("../../base-command");
11
11
  const agent_spec_1 = require("../../lib/agent-spec");
12
+ const apply_1 = require("../../lib/agent-import/apply");
13
+ const plan_1 = require("../../lib/agent-import/plan");
14
+ const sources_1 = require("../../lib/agent-import/sources");
15
+ const duties_1 = require("../../lib/duties");
16
+ const prompt_1 = require("../../lib/prompt");
17
+ const skill_import_1 = require("../../lib/skill-import");
18
+ /** What an import reads of the target agent. Closures, so the services are looked up per call. */
19
+ const TARGET_READERS = {
20
+ getBootstrap: (agentId) => data_provider_1.dataService.getBootstrap(agentId),
21
+ getBootstrapHistory: (agentId, options) => data_provider_1.dataService.getBootstrapHistory(agentId, options),
22
+ getSkillsByAgent: (agentId) => data_provider_1.dataService.getSkillsByAgent(agentId),
23
+ listProposals: (agentId, status) => data_provider_1.dataService.getAgentMemoryWorkspaceProposals(agentId, status),
24
+ listDuties: (query) => duties_1.dutyApi.list(query),
25
+ };
26
+ /** How an import writes to the target agent: each kind through the surface that owns it. */
27
+ const WRITERS = {
28
+ updatePersonaFile: ({ agentId, fileType, content, reason }) => data_provider_1.dataService.updateBootstrapFile({ agentId, fileType, content, reason }),
29
+ observeMemory: (agentId, input) => data_provider_1.dataService.observeAgentMemory(agentId, input),
30
+ createSkill: (skill, agentId) => (0, skill_import_1.createImportedSkill)(skill, agentId),
31
+ importDuty: (body) => duties_1.dutyApi.import(body),
32
+ };
12
33
  /**
13
34
  * Bring a Claude Code asset in: a subagent (`.claude/agents/<name>.md`) or a
14
- * skill (`SKILL.md`, or the directory holding one).
35
+ * skill (`SKILL.md`, or the directory holding one). Or bring a whole bot over
36
+ * from OpenClaw, Hermes or Orca: point it at the bot's folder (see
37
+ * `lib/agent-import/`), read the plan, and say yes.
15
38
  *
16
39
  * A subagent becomes an agent spec document — printed or written with
17
40
  * `--output`, or pushed onto an existing agent with `--agent` (the same push
@@ -24,42 +47,75 @@ const agent_spec_1 = require("../../lib/agent-spec");
24
47
  * import says what it did not do.
25
48
  */
26
49
  class AgentsImport extends base_command_1.BaseCommand {
27
- static description = 'Import a Claude Code subagent (.claude/agents/*.md) or SKILL.md; hooks and MCP commands are never imported';
50
+ static description = 'Import a Claude Code subagent (.claude/agents/*.md) or SKILL.md, or an OpenClaw, Hermes or Orca bot folder; hooks, MCP commands, key files and secret-looking lines are never imported';
28
51
  static examples = [
29
52
  '<%= config.bin %> agents import .claude/agents/reviewer.md --output reviewer.agent.json',
30
53
  '<%= config.bin %> agents import .claude/agents/reviewer.md --agent <agent-id>',
31
54
  '<%= config.bin %> agents import .claude/skills/release-notes --agent <agent-id>',
32
55
  '<%= config.bin %> agents import .claude/skills/release-notes/SKILL.md',
33
56
  'cat reviewer.md | <%= config.bin %> agents import - --output reviewer.agent.json',
57
+ '<%= config.bin %> agents import ~/.openclaw',
58
+ '<%= config.bin %> agents import ~/.openclaw --source-agent research --agent <agent-id>',
59
+ '<%= config.bin %> agents import ~/.hermes --agent <agent-id> --yes',
60
+ '<%= config.bin %> agents import ~/.orca/bots/sage --from orca --agent <agent-id>',
34
61
  ];
35
62
  static args = {
36
63
  path: core_1.Args.string({
37
- description: 'A .claude/agents/*.md file, a SKILL.md, a directory containing SKILL.md, or "-" to read a subagent file from stdin',
64
+ description: 'A .claude/agents/*.md file, a SKILL.md, a directory containing SKILL.md, an OpenClaw, Hermes or Orca bot folder, or "-" to read a subagent file from stdin',
38
65
  required: true,
39
66
  ignoreStdin: true,
40
67
  }),
41
68
  };
42
69
  static flags = {
43
70
  agent: core_1.Flags.string({
44
- description: 'Subagent: push the converted spec onto this agent. Skill: attach the new skill to it.',
71
+ description: 'Subagent: push the converted spec onto this agent. Skill: attach the new skill to it. Bot folder: the agent to bring the bot into (without it, only the plan is shown).',
45
72
  }),
46
73
  output: core_1.Flags.string({
47
74
  char: 'o',
48
75
  description: 'Subagent only: write the converted spec document here (omit for stdout)',
49
76
  }),
50
77
  json: core_1.Flags.boolean({ description: 'Output the result as JSON' }),
78
+ from: core_1.Flags.string({
79
+ description: 'Bot folder: the app it comes from, when its layout does not say (openclaw, hermes, orca)',
80
+ options: [...sources_1.AGENT_IMPORT_APPS],
81
+ }),
82
+ 'source-agent': core_1.Flags.string({
83
+ description: 'Bot folder: which bot in it (an OpenClaw agent id, default main; a Hermes profile; an Orca bot folder)',
84
+ }),
85
+ yes: core_1.Flags.boolean({
86
+ char: 'y',
87
+ description: 'Bot folder: import without asking (the plan is still printed)',
88
+ default: false,
89
+ }),
90
+ 'replace-persona': core_1.Flags.boolean({
91
+ description: 'Bot folder: replace persona files written on this agent (the old ones stay in their history)',
92
+ default: false,
93
+ }),
51
94
  };
52
95
  async run() {
53
96
  const { args, flags } = await this.parse(AgentsImport);
54
97
  // stdin has no file name to route on, so it is read as a subagent file;
55
98
  // a SKILL.md is imported by path, where its directory names it.
56
99
  const fromStdin = args.path === '-';
100
+ if (flags.from || (!fromStdin && (await this.isBotFolder(args.path)))) {
101
+ await this.importBot(args.path, flags);
102
+ return;
103
+ }
104
+ for (const flag of ['source-agent', 'replace-persona']) {
105
+ if (flags[flag]) {
106
+ this.failWithCliError({
107
+ message: `--${flag} applies to a bot folder from OpenClaw, Hermes or Orca.`,
108
+ code: 'IMPORT_FLAG_NOT_APPLICABLE',
109
+ exit: 2,
110
+ retryable: false,
111
+ });
112
+ }
113
+ }
57
114
  let sourcePath = args.path;
58
115
  if (!fromStdin) {
116
+ let isDirectory = false;
59
117
  try {
60
- if ((await (0, promises_1.stat)(sourcePath)).isDirectory()) {
61
- sourcePath = node_path_1.default.join(sourcePath, 'SKILL.md');
62
- }
118
+ isDirectory = (await (0, promises_1.stat)(sourcePath)).isDirectory();
63
119
  }
64
120
  catch (err) {
65
121
  this.failWithCliError({
@@ -70,6 +126,18 @@ class AgentsImport extends base_command_1.BaseCommand {
70
126
  details: { path: args.path },
71
127
  });
72
128
  }
129
+ if (isDirectory) {
130
+ sourcePath = node_path_1.default.join(sourcePath, 'SKILL.md');
131
+ if (!(await (0, promises_1.stat)(sourcePath).catch(() => null))) {
132
+ this.failWithCliError({
133
+ message: `${args.path} holds no SKILL.md and does not look like an OpenClaw, Hermes or Orca bot folder. For a bot folder, name its app with --from openclaw|hermes|orca.`,
134
+ code: 'IMPORT_SOURCE_UNKNOWN',
135
+ exit: 1,
136
+ retryable: false,
137
+ details: { path: args.path },
138
+ });
139
+ }
140
+ }
73
141
  }
74
142
  let text;
75
143
  try {
@@ -199,27 +267,13 @@ class AgentsImport extends base_command_1.BaseCommand {
199
267
  const { skill, dropped } = this.convert(() => (0, data_provider_1.skillFromSkillMarkdown)(text, { sourcePath }));
200
268
  this.requireAuth();
201
269
  let created;
270
+ let skillId;
202
271
  try {
203
- created = await data_provider_1.dataService.createSkill({
204
- agentId: flags.agent ?? null,
205
- name: skill.name,
206
- description: skill.description,
207
- content: skill.content,
208
- frontmatter: skill.frontmatter,
209
- });
272
+ ({ created, skillId } = await (0, skill_import_1.createImportedSkill)(skill, flags.agent ?? null));
210
273
  }
211
274
  catch (err) {
212
275
  this.handleApiError(err, { subject: `skill ${skill.name}` });
213
276
  }
214
- const skillId = created.id;
215
- if (flags.agent && skillId) {
216
- try {
217
- await data_provider_1.dataService.addAgentSkill({ agentId: flags.agent, skillId });
218
- }
219
- catch (err) {
220
- this.handleApiError(err, { subject: `agent ${flags.agent}` });
221
- }
222
- }
223
277
  if (flags.json) {
224
278
  this.log(JSON.stringify({ skill: created, attachedTo: flags.agent ?? null, dropped }, null, 2));
225
279
  return;
@@ -229,5 +283,139 @@ class AgentsImport extends base_command_1.BaseCommand {
229
283
  : `Imported skill ${skill.name} (${skillId ?? 'no id returned'}) into your library.`);
230
284
  this.printDropped(dropped);
231
285
  }
286
+ /** A folder with no SKILL.md whose layout is an OpenClaw, Hermes or Orca bot's. */
287
+ async isBotFolder(folder) {
288
+ const info = await (0, promises_1.stat)(folder).catch(() => null);
289
+ if (!info?.isDirectory())
290
+ return false;
291
+ if (await (0, promises_1.stat)(node_path_1.default.join(folder, 'SKILL.md')).catch(() => null))
292
+ return false;
293
+ return (0, sources_1.looksLikeBotFolder)(folder);
294
+ }
295
+ /**
296
+ * Bring a bot over from another app. Reads the folder (never a key file, never a secret-looking
297
+ * line, never a link out of it), shows the plan, and writes only after a yes: the prompt on a
298
+ * terminal, `--yes` anywhere else. Without `--agent` it shows the plan and writes nothing.
299
+ */
300
+ async importBot(folder, flags) {
301
+ if (flags.output) {
302
+ this.failWithCliError({
303
+ message: '--output applies to a subagent file; a bot folder is imported into an agent with --agent.',
304
+ code: 'IMPORT_FLAG_NOT_APPLICABLE',
305
+ exit: 2,
306
+ retryable: false,
307
+ });
308
+ }
309
+ let source;
310
+ try {
311
+ source = await (0, sources_1.readImportSource)(folder, {
312
+ app: flags.from,
313
+ sourceAgent: flags['source-agent'],
314
+ });
315
+ }
316
+ catch (err) {
317
+ if (err instanceof sources_1.AgentImportSourceError) {
318
+ this.failWithCliError({
319
+ message: err.message,
320
+ code: err.code,
321
+ exit: 1,
322
+ retryable: false,
323
+ details: { path: folder },
324
+ });
325
+ }
326
+ this.failWithCliError({
327
+ message: `Could not read ${folder}: ${err.message}`,
328
+ code: 'IMPORT_SOURCE_UNREADABLE',
329
+ exit: 1,
330
+ retryable: false,
331
+ details: { path: folder },
332
+ });
333
+ }
334
+ let target = null;
335
+ if (flags.agent) {
336
+ this.requireAuth();
337
+ try {
338
+ target = await (0, plan_1.loadImportTarget)(flags.agent, TARGET_READERS, source.persona.map((file) => file.fileType));
339
+ }
340
+ catch (err) {
341
+ this.handleApiError(err, { subject: `agent ${flags.agent}` });
342
+ }
343
+ }
344
+ const plan = (0, plan_1.buildImportPlan)(source, target, {
345
+ replacePersona: flags['replace-persona'] === true,
346
+ });
347
+ const writes = (0, plan_1.planWrites)(plan);
348
+ const showPlan = () => {
349
+ for (const line of (0, plan_1.renderImportPlan)(plan))
350
+ this.log(line);
351
+ this.log('');
352
+ };
353
+ if (!flags.agent) {
354
+ if (flags.json) {
355
+ this.log(JSON.stringify({ applied: false, ...(0, plan_1.planForOutput)(plan) }, null, 2));
356
+ return;
357
+ }
358
+ showPlan();
359
+ this.log('Nothing was written.');
360
+ this.log(`To bring ${plan.name} over, create an agent for it (skrr agents create), then run this again with --agent <agent-id>.`);
361
+ return;
362
+ }
363
+ const agentId = flags.agent;
364
+ if (writes.length === 0) {
365
+ if (flags.json) {
366
+ this.log(this.agentJson(agentId, { applied: false, ...(0, plan_1.planForOutput)(plan), results: [] }));
367
+ return;
368
+ }
369
+ showPlan();
370
+ this.log('Nothing to import: everything that can come over is already here.');
371
+ return;
372
+ }
373
+ if (!flags.yes) {
374
+ const interactive = !flags.json && Boolean(process.stdin.isTTY) && Boolean(process.stdout.isTTY);
375
+ if (!interactive) {
376
+ if (flags.json) {
377
+ this.log(this.agentJson(agentId, { applied: false, ...(0, plan_1.planForOutput)(plan) }));
378
+ return;
379
+ }
380
+ showPlan();
381
+ this.log('Nothing was written. Re-run with --yes to import it.');
382
+ return;
383
+ }
384
+ showPlan();
385
+ const yes = await (0, prompt_1.confirm)(`Import ${writes.length} item${writes.length === 1 ? '' : 's'} into agent ${agentId}?`);
386
+ if (!yes) {
387
+ this.log('Nothing was written.');
388
+ return;
389
+ }
390
+ }
391
+ else if (!flags.json) {
392
+ showPlan();
393
+ }
394
+ const results = await (0, apply_1.applyImportPlan)(plan, agentId, WRITERS);
395
+ const failed = results.filter((result) => result.outcome === 'failed');
396
+ if (flags.json) {
397
+ this.log(this.agentJson(agentId, { applied: true, ...(0, plan_1.planForOutput)(plan), results }));
398
+ }
399
+ else {
400
+ for (const line of (0, apply_1.renderApplyResults)(results))
401
+ this.log(line);
402
+ if (results.some((result) => result.area === 'duty' && result.outcome === 'written')) {
403
+ this.log('Draft Duties never run on their own. When the old bot is off, restore each schedule (skrr duties update <id> --restore-saved-cadence) and turn it on (skrr duties resume <id>).');
404
+ }
405
+ if (results.some((result) => result.area === 'memory' && result.outcome === 'written')) {
406
+ this.log(`Review the Memory proposals: skrr memory proposals list --agent ${agentId} --scope agent:${agentId}`);
407
+ }
408
+ this.printAgentUrl(agentId);
409
+ }
410
+ if (failed.length) {
411
+ this.failWithCliError({
412
+ message: `${failed.length} of ${results.length} items were not written. Run the same command again to retry them; nothing already written is written twice.`,
413
+ code: 'IMPORT_INCOMPLETE',
414
+ exit: 1,
415
+ retryable: true,
416
+ details: { failed },
417
+ });
418
+ }
419
+ }
232
420
  }
233
421
  exports.default = AgentsImport;
@@ -6,7 +6,6 @@ export default class AgentsIntuitionsAccept extends BaseCommand {
6
6
  intuitionId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
7
  };
8
8
  static flags: {
9
- 'from-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
9
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  run(): Promise<void>;
@@ -3,24 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../../base-command");
6
- const prompt_1 = require("../../../lib/prompt");
7
6
  class AgentsIntuitionsAccept extends base_command_1.BaseCommand {
8
- static description = 'Accept an intuition and create its automation';
7
+ static description = 'Take up a suggestion: prints its ask as a draft to send to the agent. Nothing is sent';
9
8
  static args = {
10
9
  agentId: core_1.Args.string({ required: true, ignoreStdin: true }),
11
10
  intuitionId: core_1.Args.string({ required: true, ignoreStdin: true }),
12
11
  };
13
12
  static flags = {
14
- 'from-json': core_1.Flags.string({ description: 'Customization JSON file or -' }),
15
13
  json: core_1.Flags.boolean({ description: 'Output JSON' }),
16
14
  };
17
15
  async run() {
18
16
  this.requireAuth();
19
17
  const { args, flags } = await this.parse(AgentsIntuitionsAccept);
20
- const result = await data_provider_1.dataService.acceptAgentIntuition(args.agentId, args.intuitionId, await (0, prompt_1.readJsonBody)(flags['from-json']));
21
- this.log(flags.json ? this.agentJson(args.agentId, result) : `Accepted intuition ${args.intuitionId}`);
22
- if (!flags.json)
23
- this.printAgentUrl(args.agentId);
18
+ let result;
19
+ try {
20
+ result = await data_provider_1.dataService.acceptAgentIntuition(args.agentId, args.intuitionId);
21
+ }
22
+ catch (err) {
23
+ this.handleApiError(err);
24
+ }
25
+ if (flags.json) {
26
+ this.log(this.agentJson(args.agentId, result));
27
+ return;
28
+ }
29
+ const draft = result?.draft;
30
+ this.log(`Accepted suggestion ${args.intuitionId}. Nothing was sent.`);
31
+ if (draft?.text) {
32
+ this.log('');
33
+ this.log('Draft:');
34
+ this.log(draft.text);
35
+ this.log('');
36
+ this.log(`Edit it and send it with: skrr agents chat ${args.agentId} --prompt "<message>"`);
37
+ }
38
+ this.printAgentUrl(args.agentId);
24
39
  }
25
40
  }
26
41
  exports.default = AgentsIntuitionsAccept;
@@ -5,7 +5,6 @@ export default class AgentsIntuitionsGenerate extends BaseCommand {
5
5
  agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
6
  };
7
7
  static flags: {
8
- force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
8
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
9
  };
11
10
  run(): Promise<void>;