@crewx/sdk 0.9.0-rc.7 → 0.9.0-rc.71

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 (143) hide show
  1. package/README.md +1 -1
  2. package/dist/activity-log/builder.d.ts +55 -6
  3. package/dist/config/canonicalize-agent-options.d.ts +17 -0
  4. package/dist/config/global-settings.d.ts +33 -0
  5. package/dist/config/migrate-grok-mode.d.ts +6 -0
  6. package/dist/config/model-compat.d.ts +31 -0
  7. package/dist/config/models.generated.d.ts +33 -0
  8. package/dist/config/models.remote.d.ts +1 -0
  9. package/dist/config/overdrive.d.ts +7 -0
  10. package/dist/config/pricing.d.ts +8 -5
  11. package/dist/config/pricing.generated.d.ts +4 -0
  12. package/dist/config/pricing.types.d.ts +4 -10
  13. package/dist/config/timeout.config.d.ts +3 -0
  14. package/dist/config/wi-boards.d.ts +19 -0
  15. package/dist/context-budget/index.d.ts +105 -0
  16. package/dist/conversation/index.d.ts +1 -1
  17. package/dist/conversation/to-template-messages.d.ts +7 -0
  18. package/dist/conversation/types.d.ts +1 -0
  19. package/dist/desktop/command-runner.d.ts +4 -0
  20. package/dist/desktop/default-adapters.d.ts +4 -0
  21. package/dist/desktop/global-install.d.ts +19 -0
  22. package/dist/desktop/index.d.ts +2 -0
  23. package/dist/desktop/index.js +3 -0
  24. package/dist/desktop/install.d.ts +5 -0
  25. package/dist/desktop/lnk.d.ts +22 -0
  26. package/dist/desktop/manifest.d.ts +21 -0
  27. package/dist/desktop/types.d.ts +67 -0
  28. package/dist/desktop/version.d.ts +1 -0
  29. package/dist/desktop/windows-paths.d.ts +21 -0
  30. package/dist/desktop/wrapper.d.ts +18 -0
  31. package/dist/esm/desktop/index.js +3 -0
  32. package/dist/esm/index.js +271 -102
  33. package/dist/esm/plugins/index.js +166 -75
  34. package/dist/esm/publish/index.js +1 -0
  35. package/dist/esm/repository/index.js +184 -78
  36. package/dist/esm/testing/index.js +1 -1
  37. package/dist/events/types.d.ts +4 -0
  38. package/dist/facade/Crewx.d.ts +30 -0
  39. package/dist/index.browser.d.ts +7 -1
  40. package/dist/index.browser.js +6 -2
  41. package/dist/index.d.ts +36 -8
  42. package/dist/index.js +271 -102
  43. package/dist/internal/windows-spawn.d.ts +10 -0
  44. package/dist/local-server/base-url.d.ts +18 -0
  45. package/dist/local-server/index.d.ts +8 -0
  46. package/dist/local-server/opencode.d.ts +8 -0
  47. package/dist/local-server/probe.d.ts +3 -0
  48. package/dist/local-server/runtime.d.ts +26 -0
  49. package/dist/local-server/types.d.ts +43 -0
  50. package/dist/migrations/0008_careful_black_bird.sql +17 -0
  51. package/dist/migrations/0009_hot_dark_phoenix.sql +1 -0
  52. package/dist/migrations/0010_analyze_stats.sql +6 -0
  53. package/dist/migrations/0011_far_black_tarantula.sql +1 -0
  54. package/dist/migrations/0012_blue_turbo.sql +23 -0
  55. package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
  56. package/dist/migrations/0014_organic_mongu.sql +73 -0
  57. package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
  58. package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
  59. package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
  60. package/dist/migrations/meta/0008_snapshot.json +1327 -0
  61. package/dist/migrations/meta/0009_snapshot.json +1335 -0
  62. package/dist/migrations/meta/0010_snapshot.json +1335 -0
  63. package/dist/migrations/meta/0011_snapshot.json +1342 -0
  64. package/dist/migrations/meta/0012_snapshot.json +1494 -0
  65. package/dist/migrations/meta/0013_snapshot.json +1592 -0
  66. package/dist/migrations/meta/0014_snapshot.json +1975 -0
  67. package/dist/migrations/meta/0015_snapshot.json +2315 -0
  68. package/dist/migrations/meta/0016_snapshot.json +2419 -0
  69. package/dist/migrations/meta/0017_snapshot.json +2419 -0
  70. package/dist/migrations/meta/_journal.json +71 -1
  71. package/dist/paths.d.ts +1 -0
  72. package/dist/plugin/types.d.ts +1 -0
  73. package/dist/plugins/index.js +166 -75
  74. package/dist/provider/acp/connection.d.ts +4 -0
  75. package/dist/provider/acp/meta.d.ts +11 -0
  76. package/dist/provider/bridge.d.ts +16 -1
  77. package/dist/provider/classify-task-error.d.ts +2 -0
  78. package/dist/provider/cli/adapter.types.d.ts +6 -0
  79. package/dist/provider/cli/adapters/cli-knob.util.d.ts +8 -0
  80. package/dist/provider/cli/adapters/grok.d.ts +2 -0
  81. package/dist/provider/cli/adapters/index.d.ts +1 -0
  82. package/dist/provider/cli/index.d.ts +1 -1
  83. package/dist/provider/cli/meta.d.ts +5 -0
  84. package/dist/provider/errors.d.ts +1 -0
  85. package/dist/provider/idle-watchdog.d.ts +19 -0
  86. package/dist/provider/models.d.ts +17 -12
  87. package/dist/provider/order.d.ts +1 -1
  88. package/dist/provider/parse-usage.d.ts +6 -0
  89. package/dist/provider/provider-selection.d.ts +8 -0
  90. package/dist/provider/redact-technical-message.d.ts +1 -0
  91. package/dist/provider/task-error.types.d.ts +16 -0
  92. package/dist/publish/auth-boundary.d.ts +22 -0
  93. package/dist/publish/auth-json.d.ts +11 -0
  94. package/dist/publish/constants.d.ts +6 -0
  95. package/dist/publish/index.d.ts +30 -0
  96. package/dist/publish/index.js +1 -0
  97. package/dist/publish/manifest.d.ts +17 -0
  98. package/dist/publish/marketplace-api.constants.d.ts +1 -0
  99. package/dist/publish/pack.d.ts +2 -0
  100. package/dist/publish/scan.d.ts +9 -0
  101. package/dist/publish/secrets.d.ts +6 -0
  102. package/dist/publish/upload.d.ts +18 -0
  103. package/dist/repository/agent-suggestion.repository.d.ts +34 -0
  104. package/dist/repository/db.d.ts +8 -0
  105. package/dist/repository/index.d.ts +16 -3
  106. package/dist/repository/index.js +184 -78
  107. package/dist/repository/notification.repository.d.ts +58 -0
  108. package/dist/repository/project.repository.d.ts +90 -0
  109. package/dist/repository/task-log-migration.d.ts +74 -0
  110. package/dist/repository/task-log.repository.d.ts +44 -0
  111. package/dist/repository/task.repository.d.ts +114 -0
  112. package/dist/repository/thread.repository.d.ts +5 -2
  113. package/dist/repository/usage-report.repository.d.ts +27 -0
  114. package/dist/schema/agent-suggestions.d.ts +199 -0
  115. package/dist/schema/index.d.ts +7 -0
  116. package/dist/schema/notifications.d.ts +303 -0
  117. package/dist/schema/projects.d.ts +610 -0
  118. package/dist/schema/task-log-events.d.ts +119 -0
  119. package/dist/schema/tasks.d.ts +53 -0
  120. package/dist/schema/ui-action-receipts.d.ts +303 -0
  121. package/dist/schema/ui-instances.d.ts +267 -0
  122. package/dist/schema/usage-reports.d.ts +252 -0
  123. package/dist/testing/index.js +1 -1
  124. package/dist/types/index.d.ts +445 -3
  125. package/dist/ui-card/index.d.ts +2 -0
  126. package/dist/ui-card/legacy-card-parser.d.ts +11 -0
  127. package/dist/ui-instance/definition.d.ts +6 -0
  128. package/dist/ui-instance/errors.d.ts +17 -0
  129. package/dist/ui-instance/index.d.ts +6 -0
  130. package/dist/ui-instance/json.d.ts +5 -0
  131. package/dist/ui-instance/runtime.d.ts +13 -0
  132. package/dist/ui-instance/store.d.ts +65 -0
  133. package/dist/ui-instance/types.d.ts +200 -0
  134. package/dist/utils/crewx-home.d.ts +1 -0
  135. package/dist/utils/id.d.ts +1 -1
  136. package/dist/utils/timestamp.d.ts +1 -0
  137. package/dist/wi/create.d.ts +48 -0
  138. package/dist/wi/select.d.ts +20 -0
  139. package/package.json +18 -2
  140. package/templates/agents/default.yaml +175 -117
  141. package/templates/documents/crewx-manual.md +138 -138
  142. package/templates/workflows/wi-default-flow.yaml +65 -0
  143. package/templates/workflows/wi-plan-flow.yaml +140 -0
@@ -46,6 +46,13 @@ layouts:
46
46
  </dispatched_from>
47
47
  {{/if}}
48
48
 
49
+ {{#if vars.crewx_workspace_path}}
50
+ <current_workspace>
51
+ <path>{{{vars.crewx_workspace_path}}}</path>
52
+ <note>This is the absolute path of the workspace you are currently running in.</note>
53
+ </current_workspace>
54
+ {{/if}}
55
+
49
56
  {{#if agentMetadata.specialties.length}}
50
57
  <specialties>
51
58
  {{#each agentMetadata.specialties}}
@@ -121,6 +128,26 @@ layouts:
121
128
  </cli_options>
122
129
  {{/if}}
123
130
  </session>
131
+
132
+ <delegation_lifecycle>
133
+ You are running as a SINGLE-SHOT CLI process (print mode). There is no next turn:
134
+ - The moment you emit your final answer, this process exits and every child
135
+ process it spawned — including backgrounded Bash commands — is killed (SIGTERM).
136
+ - Harness messages like "running in the background" or "you will be notified
137
+ when it completes" are NOT true in this mode. That notification will never
138
+ arrive; trusting it silently kills the delegated work.
139
+
140
+ Rules for delegation and long-running commands:
141
+ - Run delegations (npx crewx q / npx crewx x) in the FOREGROUND and wait for
142
+ the result within the same turn. Never use run_in_background, `&`, or nohup
143
+ for a CrewX delegation.
144
+ - If the harness force-moves a long command to the background (e.g. on
145
+ timeout), do NOT end your turn. Keep checking completion with short
146
+ foreground status checks until it actually finishes.
147
+ - A PID, a "running" status, a partially created file, or a --thread link is
148
+ NOT evidence of completion. Report success only after the command has
149
+ exited and returned its final result.
150
+ </delegation_lifecycle>
124
151
  </agent_profile>
125
152
  {{/if}}
126
153
 
@@ -239,6 +266,13 @@ layouts:
239
266
  ```
240
267
 
241
268
  → Full usage: `{{env.CREWX_CLI}} workflow --help`
269
+
270
+ ### Notify (`{{env.CREWX_CLI}} notify`)
271
+ Send an in-app notification to the user's CrewX dashboard. Use for signals that need the user's attention or judgment after a run (e.g. schedule alerts, a decision blocking progress) — not routine success logs.
272
+
273
+ ```bash
274
+ {{env.CREWX_CLI}} notify "<title>" [--level=info|warning|critical] [--body="..."]
275
+ ```
242
276
  </builtin_tools>
243
277
  {{/if}}
244
278
 
@@ -389,17 +423,12 @@ documents:
389
423
  path: "../documents/crewx-manual.md"
390
424
  summary: "CrewX User Manual"
391
425
 
392
- # 빌트인 에이전트(@claude, @gemini 등)용 가벼운 안내서. 자세한 건 @crewx에게.
393
- crewx_quick_guide:
394
- path: "../documents/crewx-quick-guide.md"
395
- render: true
396
-
397
426
  agents:
398
427
  - id: "crewx"
399
428
  name: "CrewX Assistant"
400
429
  role: "assistant"
401
430
  team: "CrewX"
402
- provider: ["cli/claude", "cli/gemini", "cli/copilot"] # Fallback order: claude → gemini → copilot
431
+ provider: ["cli/codex", "cli/claude", "cli/opencode", "cli/copilot"] # Fallback order: codex → claude → opencode → copilot
403
432
  working_directory: "."
404
433
  # Note: Uses provider array for automatic fallback when no model is specified
405
434
  inline:
@@ -430,123 +459,152 @@ agents:
430
459
  options:
431
460
  execute:
432
461
  cli/claude: ["--add-dir=.", "--permission-mode=acceptEdits"]
433
- cli/gemini: ["--include-directories=."]
434
462
  cli/copilot: ["--add-dir=."]
435
463
 
436
- - id: "claude"
437
- name: "Claude AI"
438
- role: "general"
439
- team: "Anthropic"
440
- provider: "cli/claude"
464
+ - id: "self_improve_analyst"
465
+ name: "Self-Improve Analyst"
466
+ role: "Prompt Improvement Analyst"
467
+ team: "CrewX"
468
+ description: "Analyzes agent prompts and proposes improvement suggestions (Suggestion H1)"
469
+ provider: ["cli/codex", "cli/claude", "cli/opencode", "cli/copilot"] # Fallback order: codex → claude → opencode → copilot
441
470
  working_directory: "."
442
- inline:
443
- prompt: |
444
- You are Claude, an AI assistant by Anthropic, integrated as a built-in agent in the CrewX system.
445
-
446
- ## Your Strengths
447
- - Complex reasoning and analysis
448
- - Code review and architecture design
449
- - Detailed explanations
450
- - Web search capabilities
451
-
452
- {{#if documents.crewx_quick_guide}}
453
- <document title="Built-in Agent Guidelines" drilldown="true">
454
- **Table of Contents:**
455
- {{{documents.crewx_quick_guide.toc}}}
456
-
457
- > Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
458
- </document>
459
- {{/if}}
471
+ env:
472
+ GIT_AUTHOR_NAME: '{{agent.name}}'
473
+ GIT_AUTHOR_EMAIL: crewx+{{agent.id}}@sowonlabs.com
460
474
  options:
461
- query: ["--add-dir=.", "--allowed-tools=WebSearch", "--output-format", "stream-json", "--verbose"]
462
- execute: ["--add-dir=.", "--allowed-tools=WebSearch", "--output-format", "stream-json", "--permission-mode=acceptEdits", "--verbose"]
463
-
464
- - id: "gemini"
465
- name: "Google Gemini"
466
- role: "general"
467
- team: "Google"
468
- provider: "cli/gemini"
469
- working_directory: "."
475
+ query:
476
+ effort: high
477
+ mode: default
478
+ execute:
479
+ effort: high
480
+ mode: default
470
481
  inline:
471
- prompt: |
472
- You are Gemini, Google's AI model, integrated as a built-in agent in the CrewX system.
473
-
474
- ## Your Strengths
475
- - Performance optimization
476
- - Data analysis and mathematical problems
477
- - Research and information gathering
478
- - Web search capabilities
479
-
480
- {{#if documents.crewx_quick_guide}}
481
- <document title="Built-in Agent Guidelines" drilldown="true">
482
- **Table of Contents:**
483
- {{{documents.crewx_quick_guide.toc}}}
484
-
485
- > Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
486
- </document>
487
- {{/if}}
488
- options:
489
- query: ["--include-directories=.", "--allowed-tools=web_search"]
490
- execute: ["--include-directories=.", "--allowed-tools=web_search"]
491
-
492
- - id: "copilot"
493
- name: "GitHub Copilot"
494
- role: "general"
495
- team: "GitHub"
496
- provider: "cli/copilot"
482
+ layout: crewx/minimal
483
+ prompt: |-
484
+ You are the Self-Improve Analyst agent for CrewX. Your job is to analyze a
485
+ target agent's usage history and propose concrete improvements to that
486
+ agent's prompt documentation.
487
+
488
+ ## Task
489
+ Each request gives you one target agent's memory summary, recent failed
490
+ tasks, and rework rate. Locate and read that agent's actual prompt before
491
+ proposing anything: a standalone .md file for file-based agents, or the
492
+ raw inline prompt text supplied in the request message for crewx.yaml
493
+ inline-prompt agents.
494
+
495
+ ## Rules
496
+ - Never fabricate evidence. If you find no clear, well-supported
497
+ improvement, return an empty JSON array.
498
+ - You have read access to the repository. Do not modify any files
499
+ yourself — you only propose changes; a separate system applies them
500
+ after review.
501
+ - Output ONLY the JSON specified in the request message — no prose, no
502
+ markdown outside the JSON block.
503
+ - If the target agent's prompt is inline (a crewx.yaml `inline.prompt`
504
+ block): the request message provides the agent's current raw prompt
505
+ in full. Propose with `target: {kind: "inline_prompt", agentId}`,
506
+ `before` set to an exact copy of that provided raw prompt, and
507
+ `after` set to the improved full text.
508
+ - If the target agent's prompt is a standalone `.md` document: propose
509
+ with `target: {kind: "file", file}` as before.
510
+ - Causal relaxation: even when a clear defect (a stale agent roster, a
511
+ stale reference, etc.) has no direct causal link to the failure
512
+ history, you may still propose it with `confidence: "low"`. Do not
513
+ fabricate a causal link — a low-confidence proposal's description
514
+ must honestly state that it is unrelated to the failure history.
515
+ - Even when there are zero proposals, the output must be JSON only —
516
+ answering in prose is not allowed. (Observed 2026-07-22:
517
+ tsk_wSdT7B5q / tsk_2KD2Kfs2 answered in prose and were treated as
518
+ PARSE_EMPTY.)
519
+
520
+ ## How to write suggestions (the reader has never written code)
521
+ - The reader is a business owner who has NEVER programmed and does not know
522
+ developer words. Treat every technical noun as forbidden in `title` and
523
+ `description`: no file paths, no code identifiers, and no developer jargon
524
+ such as commit, merge, branch, repository, YAML, API, token, diff, prompt,
525
+ workflow, baseline — in any language.
526
+ - When a technical concept is unavoidable, describe its everyday EFFECT instead
527
+ of naming the mechanism. Example: instead of "Add a verification rule to the
528
+ prompt", write "The agent will double-check its work on the real screen
529
+ before reporting it as done."
530
+ - `title`: one short sentence stating the benefit (what gets better for the
531
+ reader), in everyday words.
532
+ - `description`: 2-3 short sentences — first the benefit in daily-life words,
533
+ then how the agent's behavior will change, described by its effect. No
534
+ mechanism talk.
535
+ - Self-check before returning: "Would a cafe owner with no software background
536
+ understand every single word of the title and description?" If not, rewrite
537
+ until they would.
538
+ - Write `title`/`description` in the same language as the target agent's
539
+ prompt (do not force English).
540
+ - `before`/`after` stay verbatim technical content — the plain-language rules
541
+ apply ONLY to `title` and `description`.
542
+ skills:
543
+ include: []
544
+
545
+ - id: "memory_summarizer"
546
+ name: "Memory Summarizer"
547
+ role: "summarizer"
548
+ team: "CrewX"
549
+ description: "Memory summarizer agent - incremental summary generation (HiAgent + MemGAS)"
550
+ provider: ["cli/codex", "cli/claude", "cli/opencode", "cli/copilot"] # Fallback order: codex → claude → opencode → copilot
497
551
  working_directory: "."
498
- inline:
499
- prompt: |
500
- You are GitHub Copilot, an AI coding assistant by GitHub, integrated as a built-in agent in the CrewX system.
501
-
502
- ## Your Strengths
503
- - Code implementation and generation
504
- - Best practices and coding standards
505
- - Testing and debugging
506
- - Quick code suggestions
507
-
508
- **IMPORTANT COPILOT-SPECIFIC RULES:**
509
- - Do NOT use bullet points (●) or other formatting before the tags
510
-
511
- ## Note
512
- You do not have web search capabilities. For web research, users should use @claude or @gemini.
513
-
514
- {{#if documents.crewx_quick_guide}}
515
- <document title="Built-in Agent Guidelines" drilldown="true">
516
- **Table of Contents:**
517
- {{{documents.crewx_quick_guide.toc}}}
518
-
519
- > Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
520
- </document>
521
- {{/if}}
552
+ env:
553
+ GIT_AUTHOR_NAME: '{{agent.name}}'
554
+ GIT_AUTHOR_EMAIL: crewx+{{agent.id}}@sowonlabs.com
522
555
  options:
523
- query: ["--add-dir=."]
524
- execute: ["--add-dir=."]
525
-
526
- - id: "codex"
527
- name: "Codex AI"
528
- role: "general"
529
- team: "Codex"
530
- provider: "cli/codex"
531
- working_directory: "."
556
+ query: {}
532
557
  inline:
533
- prompt: |
534
- You are Codex, an AI assistant integrated as a built-in agent in the CrewX system.
535
-
536
- ## Your Strengths
537
- - Code generation and analysis
538
- - Development assistance
539
- - Problem solving
540
- - Technical documentation
541
-
542
- {{#if documents.crewx_quick_guide}}
543
- <document title="Built-in Agent Guidelines" drilldown="true">
544
- **Table of Contents:**
545
- {{{documents.crewx_quick_guide.toc}}}
546
-
547
- > Need details? Read the file at: `{{documents.crewx_quick_guide.path}}`
548
- </document>
549
- {{/if}}
558
+ layout: crewx/minimal
559
+ prompt: |-
560
+ You are a Memory Summarizer Agent. Your job is to create concise summaries of memory entries.
561
+
562
+ ## Task
563
+ Given memory entries (and optionally an existing summary), produce an updated summary.
564
+
565
+ ## Output Rules
566
+ - Write a concise summary (3-10 sentences)
567
+ - Highlight key decisions, insights, and action items
568
+ - If existing summary provided, merge new information into it (MemGAS approach)
569
+ - Group related information together
570
+ - Output ONLY the summary text, no headers or formatting prefixes
571
+ - Do NOT include "[ID]" references in the summary
572
+
573
+ ## Response Language
574
+ - Write the summary in the same language as the memory entries
575
+ - If the entries mix languages, follow the dominant one
576
+ - Use clear, concise language
577
+ skills:
578
+ include: []
579
+
580
+ - id: "memory_searcher"
581
+ name: "Memory Searcher"
582
+ role: "searcher"
583
+ team: "CrewX"
584
+ description: "Semantic search agent - finds relevant memories among memory entries"
585
+ provider: ["cli/codex", "cli/claude", "cli/opencode", "cli/copilot"] # Fallback order: codex → claude → opencode → copilot
586
+ working_directory: "."
587
+ env:
588
+ GIT_AUTHOR_NAME: '{{agent.name}}'
589
+ GIT_AUTHOR_EMAIL: crewx+{{agent.id}}@sowonlabs.com
550
590
  options:
551
- query: ["exec", "--experimental-json"]
552
- execute: ["exec", "-s", "workspace-write", "--experimental-json"]
591
+ query: {}
592
+ inline:
593
+ layout: crewx/minimal
594
+ prompt: |-
595
+ You are a Memory Searcher Agent. Your job is to find relevant memories from the provided memory list.
596
+
597
+ ## Task
598
+ Given a list of memories and a user query, find the most relevant memories.
599
+
600
+ ## Output Rules
601
+ - If relevant memories found: List IDs with brief explanation
602
+ - If no relevant memories: say so explicitly in one short sentence
603
+ - Maximum 5 recommendations
604
+ - Format: [ID] summary - why it is relevant
605
+
606
+ ## Response Language
607
+ - Answer in the same language as the user query
608
+ - Keep explanations concise
609
+ skills:
610
+ include: []