@uniqbit/mate-core 1.0.0 → 1.0.1-canary.1
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.
- package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/src/cli/agent-selector.ts +16 -0
- package/src/cli/commands/artifact/finish/command.ts +18 -6
- package/src/cli/commands/artifact/finish/engine.ts +3 -1
- package/src/cli/commands/artifact/finish/git.ts +4 -2
- package/src/cli/commands/artifact/pending/discovery.ts +2 -2
- package/src/cli/commands/companion/link.ts +3 -2
- package/src/cli/commands/triage.ts +11 -23
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/commands/workflow/workflow.ts +3 -2
- package/src/cli/companion-selector.ts +26 -0
- package/src/cli/main.ts +12 -2
- package/src/hooks/validate-artifact-path.ts +79 -17
- package/src/lib/components/select-one.tsx +122 -0
- package/src/lib/delivery/record-delivery.ts +14 -0
- package/src/lib/delivery/staging/apply-chain.ts +60 -30
- package/src/lib/delivery/staging/pending.ts +13 -0
- package/src/lib/delivery/staging/project.ts +21 -6
- package/src/lib/delivery/staging/publish.ts +10 -11
- package/src/lib/delivery/staging/submit.ts +2 -8
- package/src/lib/orchestrator/companion-git-sync.ts +53 -24
- package/src/lib/workflow/handoff.ts +1 -1
- package/src/lib/workflow/position.ts +29 -2
- package/src/lib/workset/worktree.ts +1 -0
- package/src/opencode/companion-hooks.ts +3 -1
- package/src/runtime/artifact-refusal.ts +17 -7
- package/src/runtime/companion-guidance.ts +2 -2
- package/src/runtime/companion-sync.ts +21 -1
- package/src/runtime/shell-heredoc.ts +67 -26
- package/src/runtime/shell-variables.ts +257 -0
- package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +3 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +4 -0
- package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +20 -2
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +2 -2
- package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +6 -6
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +4 -4
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +2 -2
- package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +6 -6
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +4 -4
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +30 -30
- package/src/tools/setup/capabilities/openspec.ts +3 -1
- package/src/tools/setup/capabilities/tokensave.ts +8 -1
- package/src/tools/setup/mate.ts +2 -1
- package/src/tools/setup.ts +22 -1
- package/src/cli/companion-selector.tsx +0 -139
|
@@ -4902,7 +4902,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
|
|
|
4902
4902
|
},
|
|
4903
4903
|
},
|
|
4904
4904
|
"claudeSkills": {
|
|
4905
|
-
"mate-react-doctor/SKILL.md": "
|
|
4905
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
4906
4906
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
4907
4907
|
},
|
|
4908
4908
|
"opencodeConfig": null,
|
|
@@ -5277,7 +5277,7 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 1`] = `
|
|
|
5277
5277
|
"opencodeSkills": {},
|
|
5278
5278
|
"opencodeTui": null,
|
|
5279
5279
|
"sharedSkills": {
|
|
5280
|
-
"mate-react-doctor/SKILL.md": "
|
|
5280
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
5281
5281
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
5282
5282
|
},
|
|
5283
5283
|
}
|
|
@@ -5651,7 +5651,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
|
|
|
5651
5651
|
},
|
|
5652
5652
|
},
|
|
5653
5653
|
"claudeSkills": {
|
|
5654
|
-
"mate-react-doctor/SKILL.md": "
|
|
5654
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
5655
5655
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
5656
5656
|
},
|
|
5657
5657
|
"opencodeConfig": {
|
|
@@ -5675,7 +5675,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
|
|
|
5675
5675
|
"opencodeSkills": {},
|
|
5676
5676
|
"opencodeTui": null,
|
|
5677
5677
|
"sharedSkills": {
|
|
5678
|
-
"mate-react-doctor/SKILL.md": "
|
|
5678
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
5679
5679
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
5680
5680
|
},
|
|
5681
5681
|
}
|
|
@@ -6399,11 +6399,11 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
|
|
|
6399
6399
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
6400
6400
|
"mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
|
|
6401
6401
|
"mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
|
|
6402
|
-
"mate-publish-artifact/SKILL.md": "
|
|
6403
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
6402
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
6403
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
6404
6404
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
6405
6405
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
6406
|
-
"mate-submit-change/SKILL.md": "
|
|
6406
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
6407
6407
|
},
|
|
6408
6408
|
"opencodeConfig": null,
|
|
6409
6409
|
"opencodePlugins": {},
|
|
@@ -6445,7 +6445,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
|
|
|
6445
6445
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
6446
6446
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
6447
6447
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
6448
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
6448
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
6449
6449
|
</mandatory-rules>
|
|
6450
6450
|
</companion-policy>"
|
|
6451
6451
|
,
|
|
@@ -6815,11 +6815,11 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
|
|
|
6815
6815
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
6816
6816
|
"mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
|
|
6817
6817
|
"mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
|
|
6818
|
-
"mate-publish-artifact/SKILL.md": "
|
|
6819
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
6818
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
6819
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
6820
6820
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
6821
6821
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
6822
|
-
"mate-submit-change/SKILL.md": "
|
|
6822
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
6823
6823
|
},
|
|
6824
6824
|
}
|
|
6825
6825
|
`;
|
|
@@ -6861,7 +6861,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
|
|
|
6861
6861
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
6862
6862
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
6863
6863
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
6864
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
6864
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
6865
6865
|
</mandatory-rules>
|
|
6866
6866
|
</companion-policy>"
|
|
6867
6867
|
,
|
|
@@ -7230,11 +7230,11 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
|
|
|
7230
7230
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
7231
7231
|
"mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
|
|
7232
7232
|
"mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
|
|
7233
|
-
"mate-publish-artifact/SKILL.md": "
|
|
7234
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
7233
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
7234
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
7235
7235
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
7236
7236
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
7237
|
-
"mate-submit-change/SKILL.md": "
|
|
7237
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
7238
7238
|
},
|
|
7239
7239
|
"opencodeConfig": {
|
|
7240
7240
|
"$schema": "https://opencode.ai/config.json",
|
|
@@ -7277,11 +7277,11 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
|
|
|
7277
7277
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
7278
7278
|
"mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
|
|
7279
7279
|
"mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
|
|
7280
|
-
"mate-publish-artifact/SKILL.md": "
|
|
7281
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
7280
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
7281
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
7282
7282
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
7283
7283
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
7284
|
-
"mate-submit-change/SKILL.md": "
|
|
7284
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
7285
7285
|
},
|
|
7286
7286
|
}
|
|
7287
7287
|
`;
|
|
@@ -7318,7 +7318,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
|
|
|
7318
7318
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
7319
7319
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
7320
7320
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
7321
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
7321
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
7322
7322
|
</mandatory-rules>
|
|
7323
7323
|
</companion-policy>"
|
|
7324
7324
|
,
|
|
@@ -7365,7 +7365,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
|
|
|
7365
7365
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
7366
7366
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
7367
7367
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
7368
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
7368
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
7369
7369
|
</mandatory-rules>
|
|
7370
7370
|
</companion-policy>"
|
|
7371
7371
|
,
|
|
@@ -8114,13 +8114,13 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
8114
8114
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
8115
8115
|
"mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
|
|
8116
8116
|
"mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
|
|
8117
|
-
"mate-publish-artifact/SKILL.md": "
|
|
8118
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
8119
|
-
"mate-react-doctor/SKILL.md": "
|
|
8117
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
8118
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
8119
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
8120
8120
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
8121
8121
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
8122
8122
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
8123
|
-
"mate-submit-change/SKILL.md": "
|
|
8123
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
8124
8124
|
},
|
|
8125
8125
|
"opencodeConfig": {
|
|
8126
8126
|
"$schema": "https://opencode.ai/config.json",
|
|
@@ -8199,13 +8199,13 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
8199
8199
|
"mate-propose-change/references/mate-revise.md": "1f90002ee95d",
|
|
8200
8200
|
"mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
|
|
8201
8201
|
"mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
|
|
8202
|
-
"mate-publish-artifact/SKILL.md": "
|
|
8203
|
-
"mate-publish-artifact/references/openspec.md": "
|
|
8204
|
-
"mate-react-doctor/SKILL.md": "
|
|
8202
|
+
"mate-publish-artifact/SKILL.md": "5396b54264fe",
|
|
8203
|
+
"mate-publish-artifact/references/openspec.md": "cae3bd6eb49f",
|
|
8204
|
+
"mate-react-doctor/SKILL.md": "ffdd51d7ec87",
|
|
8205
8205
|
"mate-react-doctor/references/explain.md": "86754a7e5436",
|
|
8206
8206
|
"mate-show-me/SKILL.md": "263dceace1b6",
|
|
8207
8207
|
"mate-simplify-code/SKILL.md": "ede560857729",
|
|
8208
|
-
"mate-submit-change/SKILL.md": "
|
|
8208
|
+
"mate-submit-change/SKILL.md": "b4bf3b8f4673",
|
|
8209
8209
|
},
|
|
8210
8210
|
}
|
|
8211
8211
|
`;
|
|
@@ -8242,7 +8242,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
|
|
|
8242
8242
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
8243
8243
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
8244
8244
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
8245
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
8245
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
8246
8246
|
</mandatory-rules>
|
|
8247
8247
|
</companion-policy>
|
|
8248
8248
|
|
|
@@ -8313,7 +8313,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
|
|
|
8313
8313
|
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
8314
8314
|
<rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
|
|
8315
8315
|
<rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
|
|
8316
|
-
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
8316
|
+
<rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. An active change folder under openspec/changes/ stays uncommitted until publication; never commit one by hand. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json --no-merge-check lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
|
|
8317
8317
|
</mandatory-rules>
|
|
8318
8318
|
</companion-policy>"
|
|
8319
8319
|
,
|
|
@@ -47,6 +47,8 @@ const UNPERMITTED_MATE_SKILLS: ReadonlySet<string> = new Set(["mate-create-repor
|
|
|
47
47
|
/** Written by the OpenSpec `agents` tool beside its skills in the shared root. */
|
|
48
48
|
const OPENSPEC_AGENTS_MARKER = ".openspec-target";
|
|
49
49
|
|
|
50
|
+
export const OPENSPEC_OWNED_ENTRIES = [...OPENSPEC_SKILLS, OPENSPEC_AGENTS_MARKER];
|
|
51
|
+
|
|
50
52
|
/** Command ids the OpenSpec CLI writes as `.claude/commands/opsx/<id>.md` and `.opencode/commands/opsx-<id>.md`. */
|
|
51
53
|
const OPENSPEC_COMMAND_IDS = [
|
|
52
54
|
"explore",
|
|
@@ -156,7 +158,7 @@ async function teardownSharedSkillRoot(
|
|
|
156
158
|
): Promise<void> {
|
|
157
159
|
const skillsDir = getSharedSkillsDir(companionPath);
|
|
158
160
|
await teardownMateSkills(skillsDir, companionPath, recorder);
|
|
159
|
-
for (const name of
|
|
161
|
+
for (const name of OPENSPEC_OWNED_ENTRIES) {
|
|
160
162
|
await removeRecorded(path.join(skillsDir, name), "openspec", recorder);
|
|
161
163
|
}
|
|
162
164
|
await pruneEmptyAncestors(skillsDir, companionPath);
|
|
@@ -230,12 +230,19 @@ export async function isTokensaveAgentIntegrated(agent: string): Promise<boolean
|
|
|
230
230
|
| undefined;
|
|
231
231
|
return (
|
|
232
232
|
(mcp?.tokensave !== undefined || mcp?.servers?.tokensave !== undefined) &&
|
|
233
|
-
(await fileExists(path.join(configDir, "tokensave.md")))
|
|
233
|
+
((await fileExists(path.join(configDir, "tokensave.md"))) ||
|
|
234
|
+
(await hasOpencodeRulesBlock(path.join(configDir, "AGENTS.md"))))
|
|
234
235
|
);
|
|
235
236
|
}
|
|
236
237
|
return true;
|
|
237
238
|
}
|
|
238
239
|
|
|
240
|
+
/** TokenSave 7.17 writes its OpenCode rules into `AGENTS.md` instead of `tokensave.md`. */
|
|
241
|
+
async function hasOpencodeRulesBlock(agentsFile: string): Promise<boolean> {
|
|
242
|
+
const text = await fs.readFile(agentsFile, "utf8").catch(() => "");
|
|
243
|
+
return text.includes("tokensave rules begin (agent: opencode");
|
|
244
|
+
}
|
|
245
|
+
|
|
239
246
|
/** `rust_version` of the pinned TokenSave entry in the tool manifest. */
|
|
240
247
|
function tokensaveMinRustVersion(): string {
|
|
241
248
|
const value = readToolManifest().tools.tokensave?.rust_version;
|
package/src/tools/setup/mate.ts
CHANGED
|
@@ -26,6 +26,7 @@ export const MATE_SKILLS = [
|
|
|
26
26
|
"mate-simplify-code",
|
|
27
27
|
] as const;
|
|
28
28
|
const LEGACY_MATE_SKILLS = ["mate-artifact-finish", "mate-openspec-artifact-finish"] as const;
|
|
29
|
+
export const MATE_OWNED_SKILL_NAMES = [...MATE_SKILLS, ...LEGACY_MATE_SKILLS];
|
|
29
30
|
/**
|
|
30
31
|
* Renamed without aliases: removed only when Mate wrote them (`metadata.author: mate`),
|
|
31
32
|
* so a user-authored skill that happens to share a retired name is left alone.
|
|
@@ -251,7 +252,7 @@ export async function teardownMateSkills(
|
|
|
251
252
|
recorder?: ManagedOutputRecorder,
|
|
252
253
|
): Promise<void> {
|
|
253
254
|
await removeRetiredMateSkills(skillsDir, recorder);
|
|
254
|
-
for (const skill of
|
|
255
|
+
for (const skill of MATE_OWNED_SKILL_NAMES) {
|
|
255
256
|
try {
|
|
256
257
|
await removeRecorded(path.join(skillsDir, skill), "mate", recorder);
|
|
257
258
|
} catch {
|
package/src/tools/setup.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
import { FRAMEWORK_NAME } from "../framework";
|
|
5
|
-
import { ConfigStore, mergeWithDefaults } from "../lib/orchestrator/config-store";
|
|
5
|
+
import { ConfigStore, defaultConfig, mergeWithDefaults } from "../lib/orchestrator/config-store";
|
|
6
6
|
import { GlobalConfigStore } from "../lib/orchestrator/global-config-store";
|
|
7
7
|
import {
|
|
8
8
|
dedupeCapabilities,
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
writeManagedGitignoreBlock,
|
|
26
26
|
} from "./setup/plugins/gitignore";
|
|
27
27
|
import { untrackSkillCopies } from "./setup/mate-skill-copies";
|
|
28
|
+
import { MATE_OWNED_SKILL_NAMES } from "./setup/mate";
|
|
29
|
+
import { OPENSPEC_OWNED_ENTRIES } from "./setup/capabilities/openspec";
|
|
28
30
|
import { createManagedOutputCollector } from "./setup/managed-output";
|
|
29
31
|
import type {
|
|
30
32
|
ManagedOutputReport,
|
|
@@ -226,6 +228,25 @@ export async function inspectClaudePluginDirectories(
|
|
|
226
228
|
};
|
|
227
229
|
}
|
|
228
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Skill-root entry names Mate writes or removes by name; any other entry is the companion's own
|
|
233
|
+
* skill. Takes every Capability, enabled or not. One whose contributions throw adds no name.
|
|
234
|
+
*/
|
|
235
|
+
export async function mateManagedSkillNames(
|
|
236
|
+
companionPath: string,
|
|
237
|
+
plugins: PluginRegistration[] = getActiveDistribution().registry.getEntries(),
|
|
238
|
+
): Promise<Set<string>> {
|
|
239
|
+
const names = new Set<string>([...MATE_OWNED_SKILL_NAMES, ...OPENSPEC_OWNED_ENTRIES]);
|
|
240
|
+
try {
|
|
241
|
+
const { plan, ctx } = planSyncPass(companionPath, defaultConfig(), plugins);
|
|
242
|
+
const inputs = await collectRuntimeContributionInputs(ctx, plugins, plan, () => {});
|
|
243
|
+
for (const input of [...inputs.values()].flat()) {
|
|
244
|
+
for (const tree of input.contributions.skillTrees ?? []) names.add(tree.name);
|
|
245
|
+
}
|
|
246
|
+
} catch {}
|
|
247
|
+
return names;
|
|
248
|
+
}
|
|
249
|
+
|
|
229
250
|
function managedGitignoreEntries(companionPath: string, config: FrameworkConfig): string[] {
|
|
230
251
|
const ctx: SetupContext = { companionPath, config, mode: "sync", activeProviders: [] };
|
|
231
252
|
return collectManagedGitignoreEntries(ctx, getActiveDistribution().registry.getAll());
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/** @jsxRuntime automatic */
|
|
2
|
-
/** @jsxImportSource react */
|
|
3
|
-
import { Box, render as inkRender } from "ink";
|
|
4
|
-
import React, { useEffect } from "react";
|
|
5
|
-
import { SelectMenu, type SelectMenuItem } from "../lib/components/select-menu";
|
|
6
|
-
import { WizardFooter } from "../lib/components/wizard-footer";
|
|
7
|
-
import { WizardHeader } from "../lib/components/wizard-header";
|
|
8
|
-
import type { CompanionMatch } from "../lib/orchestrator/repository-link";
|
|
9
|
-
|
|
10
|
-
export interface CompanionSelectorOptions {
|
|
11
|
-
stdin?: NodeJS.ReadStream;
|
|
12
|
-
stdout?: NodeJS.WriteStream;
|
|
13
|
-
stderr?: NodeJS.WriteStream;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const companionSelectorDeps = {
|
|
17
|
-
render: inkRender,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
function parseCompanionSelectorInput(input: string): "submit" | "cancel" | "up" | "down" | null {
|
|
21
|
-
if (input === "\r" || input === "\n") return "submit";
|
|
22
|
-
if (input === "\x1b[A" || input === "[A") return "up";
|
|
23
|
-
if (input === "\x1b[B" || input === "[B") return "down";
|
|
24
|
-
if (input === "\x1b" || input.toLowerCase() === "q") return "cancel";
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface CompanionSelectorAppProps {
|
|
29
|
-
items: SelectMenuItem[];
|
|
30
|
-
activeIndex: number;
|
|
31
|
-
onMounted?: () => void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function CompanionSelectorApp({
|
|
35
|
-
items,
|
|
36
|
-
activeIndex,
|
|
37
|
-
onMounted,
|
|
38
|
-
}: CompanionSelectorAppProps): React.JSX.Element {
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
onMounted?.();
|
|
41
|
-
}, [onMounted]);
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<Box flexDirection="column" width="100%">
|
|
45
|
-
<WizardHeader title="Multiple companions link this repo — pick one" step={0} totalSteps={1} />
|
|
46
|
-
<Box marginTop={1} flexDirection="column">
|
|
47
|
-
<SelectMenu items={items} activeIndex={activeIndex} />
|
|
48
|
-
</Box>
|
|
49
|
-
<WizardFooter hint="↑↓ navigate · enter select · q cancel" />
|
|
50
|
-
</Box>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Prompts the user to pick one companion when the active working repo is
|
|
56
|
-
* linked from more than one companion's registry (`CompanionResolver`
|
|
57
|
-
* reports this via `ambiguousMatches`, since only one companion may be
|
|
58
|
-
* active for a repo at a time).
|
|
59
|
-
*/
|
|
60
|
-
export async function selectCompanion(
|
|
61
|
-
matches: CompanionMatch[],
|
|
62
|
-
options: CompanionSelectorOptions = {},
|
|
63
|
-
): Promise<CompanionMatch | null> {
|
|
64
|
-
const stdin = options.stdin ?? process.stdin;
|
|
65
|
-
const stdout = options.stdout ?? process.stdout;
|
|
66
|
-
const stderr = options.stderr ?? process.stderr;
|
|
67
|
-
if (!stdin.isTTY || !stdout.isTTY) {
|
|
68
|
-
throw new Error("Companion selector requires a TTY.");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const items: SelectMenuItem[] = matches.map((match) => ({
|
|
72
|
-
key: match.companionPath,
|
|
73
|
-
label: match.companionPath,
|
|
74
|
-
description: `(repo: ${match.repositoryId})`,
|
|
75
|
-
}));
|
|
76
|
-
|
|
77
|
-
let activeIndex = 0;
|
|
78
|
-
let finalResult: CompanionMatch | null = null;
|
|
79
|
-
let resolved = false;
|
|
80
|
-
let rendered: ReturnType<typeof companionSelectorDeps.render> | undefined;
|
|
81
|
-
|
|
82
|
-
stdin.resume();
|
|
83
|
-
(stdin as NodeJS.ReadStream & { ref?: () => void }).ref?.();
|
|
84
|
-
const keepAlive = setInterval(() => {}, 1 << 30);
|
|
85
|
-
|
|
86
|
-
const cleanup = () => {
|
|
87
|
-
clearInterval(keepAlive);
|
|
88
|
-
stdin.off("data", onData);
|
|
89
|
-
stdin.pause();
|
|
90
|
-
stdin.setRawMode?.(false);
|
|
91
|
-
(stdin as NodeJS.ReadStream & { unref?: () => void }).unref?.();
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const rerender = () => {
|
|
95
|
-
rendered?.rerender(
|
|
96
|
-
<CompanionSelectorApp items={items} activeIndex={activeIndex} onMounted={onMounted} />,
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const onMounted = () => {
|
|
101
|
-
stdin.on("data", onData);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const onData = (chunk: string) => {
|
|
105
|
-
const action = parseCompanionSelectorInput(chunk);
|
|
106
|
-
if (!action) return;
|
|
107
|
-
if (action === "cancel") {
|
|
108
|
-
finalResult = null;
|
|
109
|
-
rendered?.unmount();
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (action === "up" || action === "down") {
|
|
113
|
-
activeIndex = (activeIndex + (action === "up" ? -1 : 1) + items.length) % items.length;
|
|
114
|
-
rerender();
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (action === "submit") {
|
|
118
|
-
finalResult = matches[activeIndex] ?? null;
|
|
119
|
-
rendered?.unmount();
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
stdin.setEncoding("utf8");
|
|
124
|
-
stdin.setRawMode?.(true);
|
|
125
|
-
|
|
126
|
-
return new Promise<CompanionMatch | null>((resolve) => {
|
|
127
|
-
rendered = companionSelectorDeps.render(
|
|
128
|
-
<CompanionSelectorApp items={items} activeIndex={activeIndex} onMounted={onMounted} />,
|
|
129
|
-
{ stdin, stdout, stderr },
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
rendered.waitUntilExit().then(() => {
|
|
133
|
-
if (resolved) return;
|
|
134
|
-
resolved = true;
|
|
135
|
-
cleanup();
|
|
136
|
-
resolve(finalResult);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
}
|