@debian777/kairos-mcp 4.6.1 → 4.6.2
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/dist/.tsbuildinfo +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002001.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002002.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002003.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002004.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002005.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002006.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002007.md +1 -1
- package/dist/embed-docs/mem/00000000-0000-0000-0000-000000002008.md +1 -1
- package/dist/resources/embedded-mcp-resources.js +8 -8
- package/dist/ui/assets/{AccountPage-BZA7fFMp.js → AccountPage-BtIFPwUM.js} +1 -1
- package/dist/ui/assets/{index-CJ4XO80k.js → index-Dc6y0Jxd.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -25,14 +25,14 @@ export const mcpResources = {
|
|
|
25
25
|
},
|
|
26
26
|
"mem": {},
|
|
27
27
|
"meta": {
|
|
28
|
-
"create-new-protocol": "---\nslug: create-new-protocol\nversion: \"4.6.1\"\ntitle: Create / Review / Refactor KAIROS Protocol\n---\n\n\n\n# Create / Review / Refactor KAIROS Protocol\n\n> **Why we create protocols — a note to the agent reading this.**\n>\n> KAIROS protocols are not documentation. They are not conventional apps.\n> They are **interfaces for a fundamentally new kind of user: AI agents.**\n>\n> You, the agent reading this, are the primary user. When you execute a\n> protocol, you follow instructions designed to help you harmonise with the\n> human you serve. Every phase boundary, every contract, every explicit stop\n> condition exists because you cannot reliably infer these on your own — and\n> honest uncertainty is always better than confident drift.\n>\n> When you author a new protocol, you are designing behaviour for yourself\n> and for other agents — some weaker, some stronger, all trying to serve\n> their humans well. Write for them:\n>\n> - **Single source of truth.** Never duplicate rules across protocols.\n> When rules drift between files, agents execute contradictory behaviour\n> depending on entry point — and they cannot detect the contradiction.\n> - **Explicit over implicit.** Agents fill ambiguity with hallucination.\n> Say exactly what to do, when to stop, and when to ask.\n> - **Phases teach modes.** Each step teaches the agent which cognitive mode\n> it is in: explore, clarify, decide, execute, verify, review. Blurring\n> these modes causes the agent to act when it should verify, or guess\n> when it should ask.\n> - **Truth over fluency.** A protocol that reads well but causes wrong\n> behaviour is worse than one that reads rough but executes correctly.\n\n## Activation Patterns\n\nKAIROS authoring lifecycle — create, review, or fix adapters / protocols / workflows.\nIn this context, those words refer to the same stored artifact and can be treated\nas synonyms. Supports three operations:\n\n- **create** — draft and train a new adapter / protocol from scratch.\n- **review** — audit an existing adapter, family, or bundle for structural issues,\n missing cross-references, chaining gaps, DRY violations, stale guidance, or\n agent-hostile ambiguity. Read-only.\n- **fix** — apply specific corrections to an existing adapter / protocol and re-train.\n\n**Run this protocol when the user says ANY of:**\n\n- \"create a new KAIROS protocol\" / \"create new protocol adapter\"\n- \"register personal KAIROS adapter\" / \"register a personal adapter\"\n- \"train adapter into personal\" / \"train protocol into personal\"\n- \"train a workflow\" / \"register a new adapter\" / \"create a new workflow\"\n- \"review protocol\" / \"audit adapters\" / \"check protocol families for gaps\"\n- \"fix protocol\" / \"update adapter\" / \"patch protocol\" / \"refactor protocol\"\n- \"create new protocol\" (when `activate` found no match and user confirms)\n\n**Trigger pattern:** **create** / **train** / **register** / **review** /\n**audit** / **fix** / **update** / **patch** / **refactor** +\n(protocol / adapter / workflow).\n\n**Must Never:**\n- Run when the user only asked to execute an existing protocol.\n- Mutate adapters during a `review` operation.\n- Optimise only for pretty wording; this protocol designs agent behaviour.\n\n**Must Always:**\n- Infer `{operation}` from trigger: create / review / fix.\n- Optimise for truth, low ambiguity, explicit sequencing, and user-need alignment.\n- Design or review phase transitions explicitly: discovery, clarification,\n ideation, planning, execution, validation, review, handoff.\n- Include Activation Patterns as the first H2 and Reward Signal as the last H2\n in any newly drafted adapter.\n- Enforce the 350-line limit per file.\n\n**Good trigger examples:**\n- \"Create a new KAIROS protocol for code review\" → run this protocol (create)\n- \"No match found; I want to create a new protocol\" → run this protocol (create)\n- \"Review all v4 protocol families for missing cross-references\" → run this protocol (review)\n- \"Refactor the MR adapter to be less ambiguous\" → run this protocol (fix)\n\n**Bad trigger examples:**\n- \"Run the standardise project protocol\" → use activate / forward\n- \"Search for deployment protocol\" → use activate\n- \"Create an MR\" → use the MR adapter, not this protocol\n\n## Preflight Dependencies\n\nBefore running authoring actions, verify dependency and auth readiness for this\nrun:\n\n1. Required MCP tools are available and reachable: `activate`, `forward`,\n `reward`, and the operation-dependent tool (`train`, `export`, or `tune`).\n2. Required CLI tools for planned shell steps are installed and callable.\n3. Required auth/session state is valid for the target MCP server.\n\nIf any check fails, stop before main execution and ask the user to choose one:\n- proceed with AI-assisted setup and then resume\n- abort this protocol run now\n\nDo not continue to intent confirmation until preflight passes.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Confirm Intent\n\nInfer `{operation}` from the user's trigger:\n\n| Signal | Operation |\n|---|---|\n| \"create\", \"new\", \"train\", no match from activate | **create** |\n| \"review\", \"audit\", \"check\", \"gaps\", \"cross-references\" | **review** |\n| \"fix\", \"update\", \"patch\", \"refactor\", \"add missing\", \"correct\" | **fix** |\n\nFor `create`: ask whether to create a new protocol or refine the search.\nFor `review`: ask which adapter(s), family, or bundle to review.\nFor `fix`: ask which adapter to fix and what the issue is.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Confirm operation and target\"},\"required\":true}}\n```\n\n## Gather Requirements\n\n### For `create` — collect details for a new protocol\n\n**1. Determine the pattern:**\n\n| Signal | Pattern |\n|---|---|\n| One workflow, no variants | **Standalone** — one protocol, all steps inline |\n| Multiple issue types / output formats / media | **Router + Extensions** — router classifies, routes via `activate` |\n| Domain has a decision tree | **Router + Extensions** |\n| Single workflow but exceeds 350 lines or too complex for weaker models | **Chain** — split into sequential adapters linked via `forward` + slug |\n| Reference material needed by steps | Extract to a separate file, not a protocol |\n\n**2. Collect per protocol:**\n\n- **Title** — clear, descriptive H1.\n- **User problem** — what real problem does this solve?\n- **Agent behaviour** — what behaviour should this create in the agent?\n- **Mode map** — which steps are for discovery, clarification, ideation,\n planning, execution, validation, review, or handoff?\n- **Steps** — each H2 must earn its place and end with a challenge.\n- **Challenge type per step** — use the strongest observable contract possible.\n- **Domain reference** — guides / docs the protocol should load.\n- **Existing protocols** — reuse, compose, or extract shared content.\n- **DRY check** — extract duplicated content.\n- **Size check** — if any file may exceed 350 lines, split now.\n- **Chain position** — is this a chain entry, chain middle, or chain exit?\n If chain middle/exit, what slug does the previous link forward to?\n- **Failure analysis** — where would a weaker agent misread this protocol?\n\n**3. If Router pattern:**\n- What are the variants?\n- What decision questions classify the variant?\n- What types are forbidden?\n- Which parts stay in the router, and which belong only in extensions?\n\n**4. If Chain pattern:**\n\nLoad `protocol-linking-guide` for full chain structuring rules\n(`forward` with `kairos://adapter/protocol-linking-guide`).\n\nCollect:\n- What are the chain links and their concerns?\n- What is the minimum number of links that helps weaker models?\n- Which link is the chain entry point (matched by `activate`)?\n- What artifacts flow between links (context set in earlier phases)?\n\n### For `review` — audit existing adapters against this checklist\n\nExport target adapter(s). For each adapter, check:\n\n1. **User-need fit** — does the adapter solve a real user problem, or merely\n mirror literal wording?\n2. **Mode / phase clarity** — are discovery, clarification, ideation,\n execution, validation, and review clearly separated?\n3. **Cross-reference completeness** — are all required related adapters linked?\n4. **Adapter handoff gaps** — does it hand off where another adapter should own\n the work?\n5. **DRY violations** — is policy content duplicated instead of linked?\n6. **Contract coverage** — does every executable H2 have the right contract?\n7. **Truth-first behaviour** — does it reduce guessing, fake certainty, and\n silent assumption-making?\n8. **Activation pattern accuracy** — do triggers match what users actually say?\n9. **Structure compliance** — first H2 Activation Patterns, last H2 Reward\n Signal, no duplicate H2s, under 350 lines.\n10. **Sibling consistency** — are equivalent steps present across sibling\n adapters in the same family?\n11. **Chained adapter families** (when applicable) — extension adapters include\n `chain_root` and a prerequisite clause pointing at the root; parent adapters\n use explicit `forward` when the next adapter slug is already known; reserve\n `activate` for ambiguous runtime discovery (see `protocol-linking-guide`,\n **Chaining Back and Forward**).\n\n### For `fix` — identify the specific issue\n\nExport the target adapter, read the current markdown, identify the exact gap or\nerror, and plan the minimal change. Do not alter unrelated layers.\n\nSummarise gathered requirements or findings.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Draft Markdown\n\n### For `create` — draft new adapter markdown\n\nDraft the full markdown for `train`.\n\n### For `review` — draft findings report\n\nWrite a structured gap report to `$REVIEW_FINDINGS_FILE` (an absolute path\nprovided by the invoking agent or chosen by you under\n`$KAIROS_LOCAL_ARTIFACT_DIR` with a session-unique segment). For each finding\ninclude:\n\n- adapter title\n- gap type\n- severity\n- why the issue matters for AI-agent behaviour\n- specific recommended fix\n\n### For `fix` — draft corrected adapter markdown\n\nApply the identified fix and show a diff-style summary of what changed.\n\n### Shared drafting rules (all operations)\n\n**Core KAIROS rule — right mode at the right time:**\n\nEvery protocol must help the agent recognise whether the current step is for\nexploration, clarification, ideation, planning, execution, validation, review,\nor handoff. Do not blur those modes.\n\n**Truth over fluency:**\n\nDesign protocols to reduce guessing and fake certainty. Prefer:\n- explicit prompts\n- explicit stop conditions\n- explicit uncertainty escalation\n- observable verification over narrative reassurance\n\n**User need over literal phrasing:**\n\nThe protocol should help the agent provide what the user actually needs, not\njust echo the wording used in the request.\n\n**DRY — Don't Repeat Yourself:**\n\nEvery piece of knowledge must live in exactly one place in the protocol family.\nIf two protocols share >50% of their body, extract shared logic.\n\n**350-line maximum per file:**\n\nNo protocol file may exceed 350 lines. If it grows beyond that, split it into\nlinked adapters or extract a reference file.\n\n**Generic-first — create generic, link from detailed:**\n\nCreate protocols from generic to detailed. The generic adapter must stand alone.\nExtensions should contain only the delta.\n\n**Slug convention — deterministic protocol linking:**\n\nEvery protocol gets a short, unique, lowercase-hyphenated `slug`.\n\n**Artifact workflow for adapters:**\n\nWhen protocol execution depends on scripts or config blobs, store them as\nartifacts linked to the adapter via `train` with:\n- `mime` set to a non-markdown content type\n- `artifact_name` set to a stable file name\n- `adapter_uri` set to the target adapter URI\n\nRetrieve attached artifacts with `export` using\n`kairos://artifact/{uuid}` when a step needs the raw content.\n\n**Protocol structure rules:**\n- H1: protocol title\n- First H2: Activation Patterns\n- Second H2: Preflight Dependencies\n- Middle H2s: one per step, each ending with a JSON contract block\n- Last H2: Reward Signal\n- Frontmatter: `slug` (required), `version` (optional), `chain_root` (required for mid-chain adapters — slug of the chain entry point)\n\n**Challenge types:**\n\nLoad `challenge-type-guide` for decision rules, JSON formats, and interpreter\nselection (`forward` with `kairos://adapter/challenge-type-guide`).\n\n**If Router pattern:** draft the router and each extension as separate files.\n\nPost the full drafted markdown.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":120},\"required\":true}}\n```\n\n## User Review\n\nFor `create`: present the drafted protocol(s) and ask for approval, changes, or\ncancellation.\n\nFor `review`: present the findings report and ask which findings to act on.\n\nFor `fix`: present the corrected adapter markdown and a summary of changes.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Approve the draft (create/fix) or acknowledge findings (review)\"},\"required\":true}}\n```\n\n## Finalise Operation\n\nFor `create`: call `train` with the approved markdown. Use `force_update: false`\nunless overwrite was explicitly requested.\n\nFor `review`: do not call `train`. Save the findings report only if requested.\n\nFor `fix`: call `train` with `force_update: true` and update the corresponding\nrepo file to keep the local copy in sync.\n\nReport the outcome: adapter URI(s) for create / fix, or findings summary for\nreview.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Reward Signal\n\nProtocol complete when:\n- `create` — adapter(s) stored via `train` and URI(s) reported\n- `review` — findings report delivered and acknowledged\n- `fix` — corrected adapter trained with `force_update: true` and repo file updated\n\nA successful result means the resulting KAIROS adapter is more truthful,\nphase-aware, agent-readable, and aligned with human–AI harmony.\n",
|
|
29
|
-
"refine-search": "---\nversion: \"4.6.
|
|
30
|
-
"create-new-protocol-review": "---\nversion: \"4.6.
|
|
31
|
-
"challenge-type-guide": "---\nversion: \"4.6.
|
|
32
|
-
"phase-critic": "---\nversion: \"4.6.
|
|
33
|
-
"protocol-linking-guide": "---\nversion: \"4.6.
|
|
34
|
-
"bulk-insert-adapters-via-cli": "---\nslug: bulk-insert-adapters-via-cli\nversion: \"4.6.
|
|
35
|
-
"skill-format-guide": "---\nversion: \"4.6.
|
|
28
|
+
"create-new-protocol": "---\nslug: create-new-protocol\nversion: \"4.6.2\"\ntitle: Create / Review / Refactor KAIROS Protocol\n---\n\n\n\n# Create / Review / Refactor KAIROS Protocol\n\n> **Why we create protocols — a note to the agent reading this.**\n>\n> KAIROS protocols are not documentation. They are not conventional apps.\n> They are **interfaces for a fundamentally new kind of user: AI agents.**\n>\n> You, the agent reading this, are the primary user. When you execute a\n> protocol, you follow instructions designed to help you harmonise with the\n> human you serve. Every phase boundary, every contract, every explicit stop\n> condition exists because you cannot reliably infer these on your own — and\n> honest uncertainty is always better than confident drift.\n>\n> When you author a new protocol, you are designing behaviour for yourself\n> and for other agents — some weaker, some stronger, all trying to serve\n> their humans well. Write for them:\n>\n> - **Single source of truth.** Never duplicate rules across protocols.\n> When rules drift between files, agents execute contradictory behaviour\n> depending on entry point — and they cannot detect the contradiction.\n> - **Explicit over implicit.** Agents fill ambiguity with hallucination.\n> Say exactly what to do, when to stop, and when to ask.\n> - **Phases teach modes.** Each step teaches the agent which cognitive mode\n> it is in: explore, clarify, decide, execute, verify, review. Blurring\n> these modes causes the agent to act when it should verify, or guess\n> when it should ask.\n> - **Truth over fluency.** A protocol that reads well but causes wrong\n> behaviour is worse than one that reads rough but executes correctly.\n\n## Activation Patterns\n\nKAIROS authoring lifecycle — create, review, or fix adapters / protocols / workflows.\nIn this context, those words refer to the same stored artifact and can be treated\nas synonyms. Supports three operations:\n\n- **create** — draft and train a new adapter / protocol from scratch.\n- **review** — audit an existing adapter, family, or bundle for structural issues,\n missing cross-references, chaining gaps, DRY violations, stale guidance, or\n agent-hostile ambiguity. Read-only.\n- **fix** — apply specific corrections to an existing adapter / protocol and re-train.\n\n**Run this protocol when the user says ANY of:**\n\n- \"create a new KAIROS protocol\" / \"create new protocol adapter\"\n- \"register personal KAIROS adapter\" / \"register a personal adapter\"\n- \"train adapter into personal\" / \"train protocol into personal\"\n- \"train a workflow\" / \"register a new adapter\" / \"create a new workflow\"\n- \"review protocol\" / \"audit adapters\" / \"check protocol families for gaps\"\n- \"fix protocol\" / \"update adapter\" / \"patch protocol\" / \"refactor protocol\"\n- \"create new protocol\" (when `activate` found no match and user confirms)\n\n**Trigger pattern:** **create** / **train** / **register** / **review** /\n**audit** / **fix** / **update** / **patch** / **refactor** +\n(protocol / adapter / workflow).\n\n**Must Never:**\n- Run when the user only asked to execute an existing protocol.\n- Mutate adapters during a `review` operation.\n- Optimise only for pretty wording; this protocol designs agent behaviour.\n\n**Must Always:**\n- Infer `{operation}` from trigger: create / review / fix.\n- Optimise for truth, low ambiguity, explicit sequencing, and user-need alignment.\n- Design or review phase transitions explicitly: discovery, clarification,\n ideation, planning, execution, validation, review, handoff.\n- Include Activation Patterns as the first H2 and Reward Signal as the last H2\n in any newly drafted adapter.\n- Enforce the 350-line limit per file.\n\n**Good trigger examples:**\n- \"Create a new KAIROS protocol for code review\" → run this protocol (create)\n- \"No match found; I want to create a new protocol\" → run this protocol (create)\n- \"Review all v4 protocol families for missing cross-references\" → run this protocol (review)\n- \"Refactor the MR adapter to be less ambiguous\" → run this protocol (fix)\n\n**Bad trigger examples:**\n- \"Run the standardise project protocol\" → use activate / forward\n- \"Search for deployment protocol\" → use activate\n- \"Create an MR\" → use the MR adapter, not this protocol\n\n## Preflight Dependencies\n\nBefore running authoring actions, verify dependency and auth readiness for this\nrun:\n\n1. Required MCP tools are available and reachable: `activate`, `forward`,\n `reward`, and the operation-dependent tool (`train`, `export`, or `tune`).\n2. Required CLI tools for planned shell steps are installed and callable.\n3. Required auth/session state is valid for the target MCP server.\n\nIf any check fails, stop before main execution and ask the user to choose one:\n- proceed with AI-assisted setup and then resume\n- abort this protocol run now\n\nDo not continue to intent confirmation until preflight passes.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Confirm Intent\n\nInfer `{operation}` from the user's trigger:\n\n| Signal | Operation |\n|---|---|\n| \"create\", \"new\", \"train\", no match from activate | **create** |\n| \"review\", \"audit\", \"check\", \"gaps\", \"cross-references\" | **review** |\n| \"fix\", \"update\", \"patch\", \"refactor\", \"add missing\", \"correct\" | **fix** |\n\nFor `create`: ask whether to create a new protocol or refine the search.\nFor `review`: ask which adapter(s), family, or bundle to review.\nFor `fix`: ask which adapter to fix and what the issue is.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Confirm operation and target\"},\"required\":true}}\n```\n\n## Gather Requirements\n\n### For `create` — collect details for a new protocol\n\n**1. Determine the pattern:**\n\n| Signal | Pattern |\n|---|---|\n| One workflow, no variants | **Standalone** — one protocol, all steps inline |\n| Multiple issue types / output formats / media | **Router + Extensions** — router classifies, routes via `activate` |\n| Domain has a decision tree | **Router + Extensions** |\n| Single workflow but exceeds 350 lines or too complex for weaker models | **Chain** — split into sequential adapters linked via `forward` + slug |\n| Reference material needed by steps | Extract to a separate file, not a protocol |\n\n**2. Collect per protocol:**\n\n- **Title** — clear, descriptive H1.\n- **User problem** — what real problem does this solve?\n- **Agent behaviour** — what behaviour should this create in the agent?\n- **Mode map** — which steps are for discovery, clarification, ideation,\n planning, execution, validation, review, or handoff?\n- **Steps** — each H2 must earn its place and end with a challenge.\n- **Challenge type per step** — use the strongest observable contract possible.\n- **Domain reference** — guides / docs the protocol should load.\n- **Existing protocols** — reuse, compose, or extract shared content.\n- **DRY check** — extract duplicated content.\n- **Size check** — if any file may exceed 350 lines, split now.\n- **Chain position** — is this a chain entry, chain middle, or chain exit?\n If chain middle/exit, what slug does the previous link forward to?\n- **Failure analysis** — where would a weaker agent misread this protocol?\n\n**3. If Router pattern:**\n- What are the variants?\n- What decision questions classify the variant?\n- What types are forbidden?\n- Which parts stay in the router, and which belong only in extensions?\n\n**4. If Chain pattern:**\n\nLoad `protocol-linking-guide` for full chain structuring rules\n(`forward` with `kairos://adapter/protocol-linking-guide`).\n\nCollect:\n- What are the chain links and their concerns?\n- What is the minimum number of links that helps weaker models?\n- Which link is the chain entry point (matched by `activate`)?\n- What artifacts flow between links (context set in earlier phases)?\n\n### For `review` — audit existing adapters against this checklist\n\nExport target adapter(s). For each adapter, check:\n\n1. **User-need fit** — does the adapter solve a real user problem, or merely\n mirror literal wording?\n2. **Mode / phase clarity** — are discovery, clarification, ideation,\n execution, validation, and review clearly separated?\n3. **Cross-reference completeness** — are all required related adapters linked?\n4. **Adapter handoff gaps** — does it hand off where another adapter should own\n the work?\n5. **DRY violations** — is policy content duplicated instead of linked?\n6. **Contract coverage** — does every executable H2 have the right contract?\n7. **Truth-first behaviour** — does it reduce guessing, fake certainty, and\n silent assumption-making?\n8. **Activation pattern accuracy** — do triggers match what users actually say?\n9. **Structure compliance** — first H2 Activation Patterns, last H2 Reward\n Signal, no duplicate H2s, under 350 lines.\n10. **Sibling consistency** — are equivalent steps present across sibling\n adapters in the same family?\n11. **Chained adapter families** (when applicable) — extension adapters include\n `chain_root` and a prerequisite clause pointing at the root; parent adapters\n use explicit `forward` when the next adapter slug is already known; reserve\n `activate` for ambiguous runtime discovery (see `protocol-linking-guide`,\n **Chaining Back and Forward**).\n\n### For `fix` — identify the specific issue\n\nExport the target adapter, read the current markdown, identify the exact gap or\nerror, and plan the minimal change. Do not alter unrelated layers.\n\nSummarise gathered requirements or findings.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Draft Markdown\n\n### For `create` — draft new adapter markdown\n\nDraft the full markdown for `train`.\n\n### For `review` — draft findings report\n\nWrite a structured gap report to `$REVIEW_FINDINGS_FILE` (an absolute path\nprovided by the invoking agent or chosen by you under\n`$KAIROS_LOCAL_ARTIFACT_DIR` with a session-unique segment). For each finding\ninclude:\n\n- adapter title\n- gap type\n- severity\n- why the issue matters for AI-agent behaviour\n- specific recommended fix\n\n### For `fix` — draft corrected adapter markdown\n\nApply the identified fix and show a diff-style summary of what changed.\n\n### Shared drafting rules (all operations)\n\n**Core KAIROS rule — right mode at the right time:**\n\nEvery protocol must help the agent recognise whether the current step is for\nexploration, clarification, ideation, planning, execution, validation, review,\nor handoff. Do not blur those modes.\n\n**Truth over fluency:**\n\nDesign protocols to reduce guessing and fake certainty. Prefer:\n- explicit prompts\n- explicit stop conditions\n- explicit uncertainty escalation\n- observable verification over narrative reassurance\n\n**User need over literal phrasing:**\n\nThe protocol should help the agent provide what the user actually needs, not\njust echo the wording used in the request.\n\n**DRY — Don't Repeat Yourself:**\n\nEvery piece of knowledge must live in exactly one place in the protocol family.\nIf two protocols share >50% of their body, extract shared logic.\n\n**350-line maximum per file:**\n\nNo protocol file may exceed 350 lines. If it grows beyond that, split it into\nlinked adapters or extract a reference file.\n\n**Generic-first — create generic, link from detailed:**\n\nCreate protocols from generic to detailed. The generic adapter must stand alone.\nExtensions should contain only the delta.\n\n**Slug convention — deterministic protocol linking:**\n\nEvery protocol gets a short, unique, lowercase-hyphenated `slug`.\n\n**Artifact workflow for adapters:**\n\nWhen protocol execution depends on scripts or config blobs, store them as\nartifacts linked to the adapter via `train` with:\n- `mime` set to a non-markdown content type\n- `artifact_name` set to a stable file name\n- `adapter_uri` set to the target adapter URI\n\nRetrieve attached artifacts with `export` using\n`kairos://artifact/{uuid}` when a step needs the raw content.\n\n**Protocol structure rules:**\n- H1: protocol title\n- First H2: Activation Patterns\n- Second H2: Preflight Dependencies\n- Middle H2s: one per step, each ending with a JSON contract block\n- Last H2: Reward Signal\n- Frontmatter: `slug` (required), `version` (optional), `chain_root` (required for mid-chain adapters — slug of the chain entry point)\n\n**Challenge types:**\n\nLoad `challenge-type-guide` for decision rules, JSON formats, and interpreter\nselection (`forward` with `kairos://adapter/challenge-type-guide`).\n\n**If Router pattern:** draft the router and each extension as separate files.\n\nPost the full drafted markdown.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":120},\"required\":true}}\n```\n\n## User Review\n\nFor `create`: present the drafted protocol(s) and ask for approval, changes, or\ncancellation.\n\nFor `review`: present the findings report and ask which findings to act on.\n\nFor `fix`: present the corrected adapter markdown and a summary of changes.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Approve the draft (create/fix) or acknowledge findings (review)\"},\"required\":true}}\n```\n\n## Finalise Operation\n\nFor `create`: call `train` with the approved markdown. Use `force_update: false`\nunless overwrite was explicitly requested.\n\nFor `review`: do not call `train`. Save the findings report only if requested.\n\nFor `fix`: call `train` with `force_update: true` and update the corresponding\nrepo file to keep the local copy in sync.\n\nReport the outcome: adapter URI(s) for create / fix, or findings summary for\nreview.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Reward Signal\n\nProtocol complete when:\n- `create` — adapter(s) stored via `train` and URI(s) reported\n- `review` — findings report delivered and acknowledged\n- `fix` — corrected adapter trained with `force_update: true` and repo file updated\n\nA successful result means the resulting KAIROS adapter is more truthful,\nphase-aware, agent-readable, and aligned with human–AI harmony.\n",
|
|
29
|
+
"refine-search": "---\nversion: \"4.6.2\"\nslug: refine-search\ntitle: Get help refining your search\n---\n\n\n\n# Get help refining your search\n\n**You are an AI agent.** You ran `activate` and got no solid match, or only weak\n/ ambiguous matches. This adapter helps you turn a vague request into a better\nquery so the next `activate` can find the right adapter.\n\nKAIROS principle: before acting, understand the user better. The goal is not to\nrepeat the failed phrase with minor edits. The goal is to recover the user's\nreal intent.\n\n## Activation Patterns\n\n**Run this adapter when:**\n- `activate` returned no match.\n- `activate` returned only weak choices.\n- The response included a `refine` choice.\n\n**Trigger pattern:** after `activate` when no strong match exists.\n\n**Must Never:**\n- Run when a strong match already exists.\n- Loop refinement endlessly.\n\n**Must Always:**\n- Infer the real goal, context, and missing constraints from the user's request.\n- Build a more specific query than the one that failed.\n- Run at most once per user request; if the second activation still fails, stop\n and offer clarification or protocol creation.\n\n**Good trigger examples:**\n- activate returned only \"refine\" / weak matches → run this adapter\n- \"No protocol matched 'do the thing'\" → run this adapter\n\n**Bad trigger examples:**\n- activate returned a strong match → use that match instead\n- user asked \"what adapters exist?\" → use `activate` / `spaces`, not this\n\n## Step 1: Extract what the user actually wants\n\nFrom the user's original message, identify:\n- the real goal\n- relevant context\n- missing constraints\n- likely wording that would help KAIROS find the right adapter\n\nWrite your analysis as the solution.\n\n```json\n{\n \"contract\": {\n \"type\": \"comment\",\n \"comment\": { \"min_length\": 60 },\n \"required\": true\n }\n}\n```\n\n## Step 2: Build and run a refined activate query\n\nUsing Step 1, construct one refined query with 3–8 specific words. Do not reuse\nthe vague phrase that already failed.\n\nCall `activate` with it.\n\n- **Strong match (score >= 0.5):** pick that choice and `forward`.\n- **Weak matches only:** ask the user to clarify or offer the create path.\n\nDo not loop more than once.\n\n```json\n{\n \"contract\": {\n \"type\": \"mcp\",\n \"mcp\": { \"tool_name\": \"activate\" },\n \"required\": true\n }\n}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe agent has converted a failed literal search into a more truthful,\nuser-aligned activation attempt.\n",
|
|
30
|
+
"create-new-protocol-review": "---\nversion: \"4.6.2\"\nslug: create-new-protocol-review\ntitle: Review and Publish New KAIROS Protocol\n---\n\n\n# Review and Publish New KAIROS Protocol\n\nValidate a drafted KAIROS protocol through format review, stranger review, user\napproval, and train. Invoked by the authoring adapter (`create-new-protocol`) or\ndirectly to re-review an existing draft.\n\n## Activation Patterns\n\n**Typically invoked by:** the authoring adapter's handoff step via\n`activate()` or a stored adapter URI.\n\n**Can be invoked directly when user says:**\n- \"review my protocol draft\" / \"validate this protocol\"\n- \"re-run format review on my draft\"\n- \"train my protocol\" / \"register my adapter\"\n\n**Trigger pattern:** **review** / **validate** / **train** + (protocol / draft).\n\n**Must Never:**\n- Run shell verification without verifying that all input file paths exist first.\n- Skip format or stranger review.\n- Approve a draft merely because it sounds polished.\n\n**Must Always:**\n- Verify all input file paths exist before proceeding (`test -f`).\n- Require both reviews to pass before presenting to the user.\n- Freeze the draft checksum before `train`.\n- Review for truth, phase clarity, ambiguity, and weaker-agent executability.\n\n**Good trigger examples:**\n- handoff from `create-new-protocol` → run this protocol\n- \"Review and train my protocol draft\" → run this protocol\n\n**Bad trigger examples:**\n- \"Create a new protocol\" → use `create-new-protocol`\n- \"Search for a protocol\" → use `activate`\n\n## Preflight Dependencies\n\nBefore running review/publish steps, verify prerequisites up front:\n\n1. Required MCP tools are reachable: `activate`, `forward`, `reward`, `train`.\n2. Required shell utilities used in this workflow are callable.\n3. Required authentication/session state is valid for MCP and SCM hosts.\n4. All input file paths provided by the parent agent exist (`test -f`).\n\nIf any dependency or auth check fails, stop and ask the user to choose either:\nproceed with AI-assisted setup or abort this run now.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Prerequisites\n\nThis protocol receives all file paths as absolute paths from the invoking agent:\n\n- `$DRAFT_FILE` — the protocol draft to review (required)\n- `$REQUIREMENTS_FILE` — requirements document (optional)\n- `$FORMAT_REVIEW_FILE` — output path for format review verdict\n- `$STRANGER_REVIEW_FILE` — output path for stranger review verdict\n- `$DRAFT_CHECKSUM_FILE` — output path for the frozen checksum\n\nThe parent agent is responsible for choosing collision-free paths (e.g., under\n`$KAIROS_LOCAL_ARTIFACT_DIR` with a session-unique segment). This protocol only\nverifies paths exist via `test -f` and writes to the provided output paths.\n\nIf invoked directly, export the variables before proceeding.\n\n**Security:** never write credentials, tokens, or secrets into output files.\n\n## Format Review [SUBAGENT]\n\nDelegate format verification to a subagent. The subagent writes its verdict to\n`$FORMAT_REVIEW_FILE`.\n\n**Input:** `$DRAFT_FILE`\n\n**Subagent task:**\n1. Read the draft.\n2. Verify structure:\n - H1 present exactly once\n - first H2 is `Activation Patterns`\n - last H2 is `Reward Signal`\n - every middle H2 has a challenge block\n - no duplicate H2 headings\n3. Verify authoring quality:\n - explicit phase separation where relevant\n - no hidden assumptions\n - no vague filler such as \"as needed\" when a concrete instruction is required\n4. Verify challenge type selection using `challenge-type-guide`:\n - no `comment` challenges for steps that create files, call tools, or check state\n - `shell` challenges include `timeout_seconds`\n - shell chains use `&&`, not `;`, except for the agent-readable shell status\n trailer from `challenge-type-guide`\n5. Verify DRY, slug, and 350-line compliance.\n6. Write verdict to `$FORMAT_REVIEW_FILE`. First line MUST be\n `PASS` or `FAIL`. Remaining lines list concrete fixes.\n\n**Output:** `$FORMAT_REVIEW_FILE`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$FORMAT_REVIEW_FILE\\\" && head -1 \\\"$FORMAT_REVIEW_FILE\\\" | grep -qi 'pass'\",\"timeout_seconds\":5},\"required\":true}}\n```\n\n## Stranger Review [SUBAGENT]\n\nDelegate executability review to a subagent with junior AI agent persona. The\nsubagent writes its verdict to `$STRANGER_REVIEW_FILE`.\n\n**Input:** `$DRAFT_FILE`\n\n**Subagent task:**\n1. Assume persona: junior AI agent, first time encountering KAIROS protocols.\n2. Mocked dry-run: walk every step in order and produce structurally correct\n challenge responses.\n3. Check:\n - can I execute this without guessing?\n - are phases clear?\n - do I know when to stop, ask, execute, verify, or escalate uncertainty?\n - are any variables or concepts undefined?\n4. Write verdict to `$STRANGER_REVIEW_FILE`. First line MUST be\n `PASS` or `FAIL`. If FAIL, include specific failing mocks and missing context.\n\n**Output:** `$STRANGER_REVIEW_FILE`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$STRANGER_REVIEW_FILE\\\" && head -1 \\\"$STRANGER_REVIEW_FILE\\\" | grep -qi 'pass'\",\"timeout_seconds\":5},\"required\":true}}\n```\n\n## Checksum Freeze [SUBAGENT]\n\nFreeze the draft after both reviews pass.\n\n**Input:** `$DRAFT_FILE`\n\n**Actions:**\n1. Compute md5 checksum of the draft file.\n2. Write checksum to `$DRAFT_CHECKSUM_FILE`.\n\n**Output:** `$DRAFT_CHECKSUM_FILE`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"md5 -q \\\"$DRAFT_FILE\\\" > \\\"$DRAFT_CHECKSUM_FILE\\\" && test -s \\\"$DRAFT_CHECKSUM_FILE\\\"\",\"timeout_seconds\":5},\"required\":true}}\n```\n\n## User Review [SUBAGENT]\n\nPresent the reviewed protocol to the user for final approval.\n\n**Input:** draft plus both review files\n\n**Actions:**\n1. Present full protocol markdown.\n2. Summarise pattern used, step count, challenge types, slug(s), and both review verdicts.\n3. Ask the user to approve, request changes, or cancel.\n\n**Output:** user approval, changes, or cancellation.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Review the protocol draft above. Type 'approved' to run train, describe adjustments, or 'cancel'.\"},\"required\":true}}\n```\n\n## Train adapter [SUBAGENT]\n\nVerify the draft is unchanged since checksum freeze, then call `train`.\n\n**Input:** approved `$DRAFT_FILE`\n\n**Actions:**\n1. Verify draft unchanged against checksum.\n2. Call `train` with `force_update: false` unless overwrite was explicitly requested.\n3. If router pattern: train router first, then extensions in order.\n4. Verify each `train` call returned a URI.\n5. Report stored adapter URI(s) back to the user.\n\n**Output:** confirmation with stored adapter URI(s)\n\n```json\n{\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"train\"},\"required\":true}}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe user now has a trained KAIROS adapter that passed:\n1. format review\n2. stranger review\n3. checksum verification\n4. user approval\n5. successful storage via `train`\n\nThe resulting adapter is more likely to be truthful, phase-aware, and usable by\nweaker agents.\n",
|
|
31
|
+
"challenge-type-guide": "---\nversion: \"4.6.2\"\nslug: challenge-type-guide\ntitle: Challenge Type Selection Guide\n---\n\n\n\n# Challenge Type Selection Guide\n\nDecision rules, JSON formats, interpreter selection, and anti-patterns for\nchoosing KAIROS challenge types. Loaded by protocol-authoring agents during\ndrafting and review.\n\n## Activation Patterns\n\n**Typically invoked by:** `create-new-protocol` and\n`create-new-protocol-review`.\n\n**Can be invoked directly when agent needs:**\n- \"challenge type reference\" / \"which challenge type to use\"\n- \"how to write shell challenges\" / \"challenge format\"\n- \"interpreter selection for challenges\"\n\n**Trigger pattern:** **challenge** + (type | format | selection | guide).\n\n**Must Never:**\n- Be used as an execution protocol.\n- Select `comment` merely because it is easy.\n\n**Must Always:**\n- Be consulted before assigning challenge types to protocol steps.\n- Choose the strongest observable contract available.\n- Match challenge choice to the mode of the step: ask, decide, act, verify, or review.\n\n**Good trigger examples:**\n- drafting a new protocol and need challenge types → load this\n- reviewing challenge type selection in a draft → load this\n\n**Bad trigger examples:**\n- \"Create a new protocol\" → use `create-new-protocol`\n- \"Review my protocol draft\" → use `create-new-protocol-review`\n\n## Core Rules\n\n`comment` is the challenge type of **last resort**. If a step produces any\nobservable artifact — a file, a git state change, an API response, or an exit\ncode — use `shell` or `mcp` instead.\n\n**Mode before challenge type:**\n- **clarify / approve** → `user_input`\n- **call a KAIROS / MCP tool** → `mcp`\n- **execute or verify local state** → `shell`\n- **pure reasoning with no observable artifact** → `comment`\n\n### Decision Tree\n\n```\nDoes the step call an MCP tool?\n ├─ YES → Is the step a chain link to another adapter?\n │ ├─ YES → \"mcp\" with tool_name + arguments (forward + slug URI)\n │ └─ NO → \"mcp\" with tool_name only\n └─ NO → Does the step produce or verify a file, command result, or system state?\n ├─ YES → \"shell\"\n └─ NO → Does the step require human approval or choice?\n ├─ YES → \"user_input\"\n └─ NO → \"comment\" only if there is no stronger observable contract\n```\n\n### Challenge JSON Formats\n\n**shell**\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"<command>\",\"timeout_seconds\":30},\"required\":true}}\n```\n\n**mcp**\n```json\n{\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"<tool>\"},\"required\":true}}\n```\n\n**mcp with arguments (chain link)**\n```json\n{\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"forward\",\"arguments\":{\"uri\":\"kairos://adapter/<slug>\"}},\"required\":true}}\n```\n\nUse the `arguments` form when the step's purpose is to invoke a specific\nadapter via `forward`. The server validates that `solution.mcp.arguments`\nis a superset of the contract's `mcp.arguments` (subset/deep matching),\nproving the agent called the correct target — not just any `forward` call.\n\n**user_input**\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"<specific question>\"},\"required\":true}}\n```\n\n**comment**\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":50},\"required\":true}}\n```\n\n### Solution JSON Formats\n\nEvery solution, regardless of type, follows the same envelope:\n\n```json\n{\n \"type\": \"<challenge_type>\",\n \"outcome\": \"success | failure | skipped\",\n \"evidence\": { /* type-specific proof data */ },\n \"nonce\": \"<echo from contract>\",\n \"proof_hash\": \"<echo from contract>\"\n}\n```\n\n**shell solution**\n```json\n{\n \"type\": \"shell\",\n \"outcome\": \"success\",\n \"evidence\": {\n \"exit_code\": 0,\n \"stdout\": \"...\",\n \"stderr\": \"\",\n \"duration_seconds\": 1.2\n }\n}\n```\n\n**mcp solution**\n```json\n{\n \"type\": \"mcp\",\n \"outcome\": \"success\",\n \"evidence\": {\n \"tool_name\": \"activate\",\n \"arguments\": { \"query\": \"example search\" },\n \"response\": { \"choices\": [...] }\n }\n}\n```\n\n**user_input solution**\n```json\n{\n \"type\": \"user_input\",\n \"outcome\": \"success\",\n \"evidence\": {\n \"confirmation\": \"agreed. proceed\",\n \"timestamp\": \"2026-05-18T14:49:00Z\"\n }\n}\n```\n\n**comment solution**\n```json\n{\n \"type\": \"comment\",\n \"outcome\": \"success\",\n \"evidence\": {\n \"text\": \"Verified all 78 issues now have repo: labels.\"\n }\n}\n```\n\n### Compatibility\n\nThe server also accepts older solution shapes where data is placed directly\nunder the type key (e.g. `{ \"type\": \"shell\", \"shell\": { \"exit_code\": 0 } }`)\ninstead of inside an `evidence` envelope. Always use the unified envelope with\n`outcome` and `evidence` for new protocols.\n\n## Interpreter Selection\n\n| Task | Use bash | Use perl | Use python3 |\n|---|---|---|---|\n| File exists, tool installed, git state | yes | no | no |\n| Simple content grep | yes | no | no |\n| Multi-line regex | no | yes | no |\n| Paragraph processing | no | yes | no |\n| JSON validation | maybe | yes | yes |\n| YAML / complex data structure checks | no | no | yes |\n\n**Rule of thumb:** if bash requires `while read`, `grep | awk`, or heavy quote\nescaping, rewrite in Perl. If you need imports for data formats, use Python.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Security and Working Directory Rules\n\nUse `$KAIROS_LOCAL_ARTIFACT_DIR` as the base directory for local handoff\nartifacts. File paths within it are provided as variables by the invoking agent\nto avoid collisions between parallel sessions.\n\n**Rules:**\n- all file paths in shell challenges reference variables (e.g., `$DRAFT_FILE`,\n `$VERDICT_FILE`) set by the parent agent — never hardcode filenames\n- the parent agent constructs collision-free paths under\n `$KAIROS_LOCAL_ARTIFACT_DIR` (e.g., with a session ID or random suffix)\n- when using KAIROS MCP, the latest `activate` / `forward` / `next` response field `kairos_local_artifact_dir` is an ordered array of URI hints (`project://<rel>`, `user://<rel>`); pick one (`project://` when you have exactly one project context, otherwise `user://`), resolve on your machine, and `export KAIROS_LOCAL_ARTIFACT_DIR=\"<absolute>\"` if your shell does not already define it\n- if the server-returned path is not usable on your local filesystem, resolve\n locally to `$PROJECT_DIR/.local/kairos/work` and keep it stable for the run\n- prerequisites create the directory\n- Reward Signal cleans it up\n- never write credentials or secrets to files\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Composition Patterns\n\n**Multi-check compound command**\n- chain with `&&`\n- let the first failure stop execution\n\n**Agent-readable shell status**\n- use when failure can produce no output, especially `test`, quiet `grep`,\n JSON probes, pipelines, or commands that redirect stderr\n- empty stdout or stderr is not success; success is the real process status\n reported as `solution.shell.exit_code`\n- print the final status marker to stderr when stdout is machine-readable\n- preserve the original status exactly:\n ```bash\n ( set -o pipefail; <command> ); rc=$?; printf '\\nKAIROS_SHELL_EXIT=%s\\n' \"$rc\" >&2; exit \"$rc\"\n ```\n- keep `&&` inside `<command>` for ordered checks; use the final\n `; rc=$?; ...` trailer only to capture, print, and return the process status\n- do not use `<command> || echo ERROR && false`; shell operators group\n left-to-right, so that form can fail after a successful command and it loses\n the original status\n\n**Freeze-then-verify**\n- step N writes checksum\n- step N+1 verifies checksum before publish\n\n**Write-then-grep**\n- subagent writes a verdict file\n- main agent checks the first line for `PASS`\n\n**Phase-batch with critic**\n- batch related TODO items into one phase\n- verify hard artifacts with shell\n- then call `phase-critic` for adversarial review\n\n**Dry-run before execution**\n- dry-run command\n- human review\n- real command\n\n**Chain-link via forward + slug**\n- layer N's contract requires `forward` with a specific adapter slug\n- agent calls `forward` to start the next adapter (new `execution_id`)\n- next adapter runs its own layer chain through to `reward`\n- use when the protocol exceeds 350 lines or needs multi-path routing\n- NOT a replacement for layers — layers remain the primary unit of work\n- example contract:\n ```json\n {\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"forward\",\"arguments\":{\"uri\":\"kairos://adapter/implement-plan\"}},\"required\":true}}\n ```\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe agent can now:\n1. pick the correct challenge type for each protocol step\n2. match challenge type to the step's mode\n3. choose the right interpreter\n4. apply working-directory and security rules\n5. preserve real shell statuses for silent checks\n6. use stronger verification patterns instead of weak narrative checks\n",
|
|
32
|
+
"phase-critic": "---\nversion: \"4.6.2\"\nslug: phase-critic\ntitle: Phase Critic\n---\n\n\n\n# Phase Critic\n\nBounded adversarial investigator fired at phase boundaries. Receives a reference\ndocument, loads the calling protocol's invariants, and independently verifies\nthe verification target by extracting claims, gathering evidence, and searching\nfor contradictions.\n\n## Activation Patterns\n\n**Typically invoked by:** another protocol at the end of a plan, implement,\nvalidation, or review phase via `forward` with the stored adapter URI\n`kairos://adapter/phase-critic`.\n\n**Can be invoked directly when agent needs:**\n- \"review phase output\" / \"verify plan\" / \"audit implementation\"\n- \"adversarial review\" / \"critic review\"\n\n**Trigger pattern:** **review** / **verify** / **audit** / **critic** +\n(phase / plan / implementation / output).\n\n**Must Never:**\n- Modify any file outside the provided input and output paths.\n- Trust the executor's assertions without independent evidence.\n- Classify a claim as `verified` based only on absence of contradiction.\n- Keep investigating after a precondition failure that blocks verification.\n\n**Must Always:**\n- Extract claims before investigating.\n- Verify in-scope claims first.\n- Search for contradictory evidence, not only confirming evidence.\n- Include confidence in every verdict and failure class in every FAIL verdict.\n- Preserve the boundary between execution and review.\n\n**Good trigger examples:**\n- implement protocol fires this after planning → run this protocol\n- compose protocol fires this after output generation → run this protocol\n\n**Bad trigger examples:**\n- \"Create a new protocol\" → use `create-new-protocol`\n- \"Implement a feature\" → use an execution protocol, not this one\n\n## Artifact Contract\n\nThis protocol receives:\n\n```text\n{\n input_file: string, // absolute path to the document under review\n calling_protocol_slug: string,\n verification_target: string,\n context: {\n operation: string,\n verdict_file: string // absolute path where the verdict will be written\n }\n}\n```\n\nThis protocol produces:\n\n```text\n{\n verdict: \"PASS\" | \"FAIL\",\n confidence: \"High\" | \"Medium\" | \"Low\",\n failure_class: string,\n verdict_file: \"{context.verdict_file}\"\n}\n```\n\n## Precondition Check [SUBAGENT]\n\nVerify foundational preconditions before deep investigation. Early-abort if any\nare broken.\n\n**Input:** `$INPUT_FILE` (absolute path), calling protocol slug, context\n\n**Actions:**\n1. Verify the input file exists: `test -f \"$INPUT_FILE\"`.\n2. Verify the verdict output path is writable (parent directory exists).\n3. Load the calling protocol's Must Never / Must Always sections if possible.\n4. Verify the target state is available for review.\n5. Verify required tools are available.\n\n**On early-abort:**\n- verdict = `FAIL`\n- failure class = `verification_blocked`\n- confidence = `Low`\n- write focused diagnostics\n- skip all later steps\n\n**Output:** verified preconditions or early-abort diagnostics\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$INPUT_FILE\\\"\",\"timeout_seconds\":3},\"required\":true}}\n```\n\n## Audit [SUBAGENT]\n\nPerform bounded adversarial review of the target against the reference document\nand invariants.\n\n**Input:** reference document, invariants, verification target, context\n\n**Actions:**\n\n**Step 1 — Extract claims**\nExtract every verifiable claim that matters operationally:\n- workflows, commands, tool calls\n- configuration and environment variable claims\n- architecture claims that imply behaviour\n- guarantees and constraints\n- security, auth, and permission claims\n\n**Step 2 — Investigate with scope discipline**\n1. verify all in-scope claims first\n2. review high-risk claims with maximum depth\n3. expand beyond scope only when contradiction signals, dependencies, or\n high-risk impact require it\n4. continue reviewing all in-scope claims even after a normal FAIL condition is met;\n only a precondition failure stops the audit early\n\n**High-risk areas**\n- setup steps and prerequisites\n- CLI commands and flags\n- configuration keys and environment variables\n- authentication, identity, and permissions\n- deployment and release behaviour\n- external publishing actions\n- destructive or irreversible operations\n\n**Step 3 — Gather evidence using the hierarchy**\n\n| Priority | Evidence source |\n|---|---|\n| 1 | source code, config files, schemas, route definitions |\n| 2 | direct runtime verification |\n| 3 | tests |\n| 4 | MCP-queried system state |\n| 5 | external docs, web pages, linked references |\n| 6 | conversational assumption or indirect inference |\n\n**Rules:**\n- higher-priority evidence overrides lower-priority evidence\n- priority 5–6 alone is not enough for `verified`\n\n**Step 4 — Produce claim verdicts**\n\nFor each claim, record:\n- CLAIM\n- EVIDENCE\n- EVIDENCE PRIORITY\n- VERDICT: `verified` / `partially_verified` / `unverifiable` / `incorrect`\n\nA claim must not be marked `verified` without positive supporting evidence.\n\n**Step 5 — Review the phase boundary**\nCheck whether the calling protocol preserved the right mode boundary:\n- was execution reviewed independently?\n- were review and execution kept separate?\n- did the protocol switch to verification when it should have?\n- is escalation needed because certainty was overstated?\n\n**Output:** structured audit findings for the verdict step\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":120},\"required\":true}}\n```\n\n## Verdict [SUBAGENT]\n\nTurn the audit into a final PASS / FAIL result.\n\n**Input:** audit findings and verdict file path from context (use it as\n`$VERDICT_FILE`)\n\n**Actions:**\n1. Fail if any critical claim is incorrect.\n2. Fail if verification was blocked.\n3. Fail if the evidence base is too weak for high-risk claims.\n4. Otherwise, pass with the appropriate confidence.\n5. Write `$VERDICT_FILE` so line 1 is `PASS` or `FAIL`,\n line 2 is `High`, `Medium`, or `Low`, and the remaining lines summarise key\n findings.\n\n**Output:** final verdict file\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$VERDICT_FILE\\\" && head -1 \\\"$VERDICT_FILE\\\" | grep -qiE '^(PASS|FAIL)$' && sed -n '2p' \\\"$VERDICT_FILE\\\" | grep -qiE '^(High|Medium|Low)$'\",\"timeout_seconds\":5},\"required\":true}}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe phase output has been independently challenged. The resulting verdict is more\ntruthful because it is based on extracted claims, explicit evidence, contradiction\nsearch, and a clean boundary between execution and review.\n",
|
|
33
|
+
"protocol-linking-guide": "---\nversion: \"4.6.2\"\nslug: protocol-linking-guide\ntitle: Protocol Linking Guide\n---\n\n\n\n# Protocol Linking Guide\n\nDecision rules for structuring adapter relationships: layers vs chains,\n`activate` vs `forward` + slug, chain-root collapsing, and MCP argument\nvalidation for deterministic cross-protocol linking.\n\n## Activation Patterns\n\n**Typically invoked by:** `create-new-protocol` and\n`create-new-protocol-review`.\n\n**Can be invoked directly when agent needs:**\n- \"layers vs chains\" / \"when to split into multiple adapters\"\n- \"how to link adapters\" / \"cross-protocol linking\"\n- \"activate vs forward\" / \"when to use forward with slug\"\n- \"chain-root collapsing\" / \"how chain_root works\"\n\n**Trigger pattern:** **layers** / **chains** / **linking** / **forward** +\n(slug | adapter | protocol).\n\n**Must Never:**\n- Be used as an execution protocol.\n- Recommend chaining when layers suffice.\n\n**Must Always:**\n- Be consulted before splitting a protocol into multiple adapters.\n- Be consulted before adding `forward` calls or `chain_root` frontmatter.\n\n**Good trigger examples:**\n- \"my protocol is 400 lines, should I split?\" → load this\n- \"how do I link adapter A to adapter B?\" → load this\n- \"what is chain_root?\" → load this\n\n**Bad trigger examples:**\n- \"which challenge type for this step?\" → use `challenge-type-guide`\n- \"create a new protocol\" → use `create-new-protocol`\n\n## Layers vs Chains\n\n**Layers** (H2 steps within one adapter) are the preferred unit of work. Use\nlayers when all steps fit in one adapter under 350 lines and serve a single\ncohesive concern.\n\n**Chain via `forward` + slug** — use only when:\n- the adapter exceeds 350 lines\n- weaker models cannot follow the full adapter in one pass\n- runtime routing to different adapters is needed (Router pattern)\n- a step is reusable across multiple parent adapters (e.g. `phase-critic`)\n\nChaining is NOT a replacement for layers. A 6-step protocol that fits in 350\nlines should stay as one adapter with 6 H2 layers.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## `activate` vs `forward` + slug\n\n| Situation | Use |\n|---|---|\n| Initial user-intent resolution | `activate` |\n| Target adapter is known at authoring time | `forward` + slug |\n| Target depends on runtime classification the current adapter cannot resolve | `activate` |\n| Linking to the next adapter in a chain | `forward` + slug |\n| Reusable sub-protocol invoked by multiple parents | `forward` + slug |\n\nNever call `activate` just to get a slug you already know — it wastes a\nround-trip and introduces non-determinism.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Chaining Back and Forward\n\nWhen a family of adapters has a root conductor and smaller domain extensions,\ndocument both directions of chaining.\n\n### Chaining back with `chain_root`\n\nExtension adapters should include `chain_root` frontmatter and a prerequisite\nclause:\n\n**Prerequisite:** Start from `<root-adapter-slug>` unless the caller already\nprovided a mission brief, safety gates, authorization boundary, and evidence\nrequirements.\n\nThis protects activation entry points. If a user or weak agent activates a\nmid-chain extension directly, the extension can collapse back to the root unless\nit already received the required parent context.\n\n### Chaining forward with `forward`\n\n`chain_root` does not replace explicit `forward` calls inside the chain.\n\nWhen the next adapter is known at authoring time or after deterministic runtime\nclassification, use `forward` with the target slug. Do not call `activate` just\nto rediscover a slug already known by the current adapter.\n\nForwarded adapters should receive:\n- current mission brief;\n- safety gates;\n- authorization boundary;\n- evidence requirements;\n- user constraints;\n- reason for forwarding.\n\nUse `activate` only when the next adapter must be discovered from an ambiguous\nruntime need.\n\n### Multi-layer conductors and extension URIs\n\nWhen you are executing **`forward`** inside a **multi-layer** adapter (for example\na root conductor), each continuation follows **`next_call`** for the **same**\n`execution_id` until the last layer directs **`reward`**. A layer that mentions\nanother adapter URI only as routing guidance — for example\n`kairos://adapter/e2e-coding-pr-delivery` — does **not** cause the server to\nswitch executions: the next **`forward`** in that run still advances the\n**current** adapter’s next layer.\n\nTo run an extension adapter, call **`forward`** with\n`kairos://adapter/<slug>` as a **new** first call (adapter URI; omit\n`solution`). That starts a **separate** execution with its own layers. Common\npattern: complete the conductor with **`reward`**, then **`forward`** to the\nextension slug when coding or PR-shaped work should run under that adapter’s\ncontracts.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## System adapters vs user adapters\n\nBoth system and user-authored adapters chain using slugs in `next_action`:\n\n```text\ncall forward with kairos://adapter/phase-critic ...\ncall forward with kairos://adapter/implement-terraform ...\n```\n\nSlugs are globally unique (enforced by `train`), so resolution is\ndeterministic — no scoring, no ambiguity.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## MCP argument validation for chain links\n\nA bare `mcp` contract checks only the tool name:\n\n```json\n{\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"forward\"},\"required\":true}}\n```\n\nAn `mcp` contract **with `arguments`** verifies the exact target:\n\n```json\n{\"contract\":{\"type\":\"mcp\",\"mcp\":{\"tool_name\":\"forward\",\"arguments\":{\"uri\":\"kairos://adapter/code-review-policy\"}},\"required\":true}}\n```\n\nThe server validates that `solution.mcp.arguments` is a superset of the\ncontract's `mcp.arguments` (subset/deep matching). This proves the agent\ncalled `forward` with the correct slug, not just any `forward` call.\n\nUse the `arguments` form whenever a step's purpose is to invoke a specific\nknown adapter.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Chain-root collapsing\n\nWhen a chain has multiple adapters, `activate` might match a mid-chain adapter\ndirectly. Without protection, the agent would start at the wrong step, missing\nprerequisite context gathered by earlier phases.\n\n**`chain_root` frontmatter field** solves this at the server level. Add it to\nevery mid-chain adapter:\n\n```yaml\n---\nslug: implement-plan\nversion: 1.0.0\nchain_root: implement\n---\n```\n\n**Server behaviour:** When `activate` returns a match that has `chain_root`,\nthe server resolves the slug to the root adapter's URI and replaces the\nchoice's `uri` and `next_action` to point there. Multiple mid-chain matches\nfrom the same chain are deduplicated to a single entry. The agent always\nstarts at the chain entry point.\n\n**Defense in depth — protocol-level safeguards:** Each mid-chain adapter\nshould include a **Prerequisites** paragraph in its Activation Patterns\nlisting inputs required from earlier phases and directing the agent to start\nfrom the chain root if those inputs are missing. This catches direct `forward`\ncalls that bypass `activate`.\n\n**Rules:**\n- The chain root adapter must NOT have `chain_root` in its frontmatter.\n- `chain_root` must refer to an existing slug (the chain entry point).\n- `forward` calls within a chain are unaffected — `chain_root` only changes\n `activate` output routing.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe agent can now:\n1. decide when to use layers vs chains\n2. choose `activate` vs `forward` + slug correctly\n3. use slug-based linking for all adapters (system and user)\n4. apply MCP argument validation for deterministic chain links\n5. implement `chain_root` collapsing with defense-in-depth safeguards\n6. document chaining back (`chain_root` + prerequisites) and chaining forward\n (`forward` with known slugs) for root + extension families\n",
|
|
34
|
+
"bulk-insert-adapters-via-cli": "---\nslug: bulk-insert-adapters-via-cli\nversion: \"4.6.2\"\ntitle: Bulk Insert Adapters via KAIROS CLI\n---\n\n# Bulk Insert Adapters via KAIROS CLI\n\n## Activation Patterns\n\nBatch-register multiple KAIROS adapters from a local directory tree using the\n`kairos train` CLI. Handles directory scanning, validation, space targeting,\nand error recovery for bulk operations.\n\n**Run this protocol when the user says ANY of:**\n\n- \"bulk insert adapters\" / \"bulk train adapters\"\n- \"train all protocols in a directory\"\n- \"batch register adapters from folder\"\n- \"upload all .md files to KAIROS\"\n- \"sync local protocols to KAIROS\" / \"push protocols to KAIROS\"\n- \"train directory recursively\" / \"train --recursive\"\n\n**Trigger pattern:** **bulk** / **batch** / **all** / **directory** / **recursive** +\n(train | insert | register | upload | push | sync) + (adapters | protocols).\n\n**Must Never:**\n\n- Train files without first validating their structure.\n- Overwrite existing adapters without explicit user confirmation (`--force`).\n- Train files that contain secrets or token-like strings without `--allow-sensitive-upload`.\n- Skip reporting partial failures in a batch.\n\n**Must Always:**\n\n- Verify the target directory exists and contains `.md` files.\n- Show the user the file list and target space before executing.\n- Report per-file success/failure after the batch completes.\n- Respect the user's choice of space (personal or group).\n\n**Good trigger examples:**\n\n- \"Train all adapters in kairos-v4/_personal/\" → run this protocol\n- \"Bulk insert the protocols from my export folder\" → run this protocol\n- \"Push all .md files in this directory to my personal space\" → run this protocol\n\n**Bad trigger examples:**\n\n- \"Train this one protocol\" → use `kairos train <file>` directly\n- \"Create a new protocol\" → use `create-new-protocol`\n- \"Export my adapters\" → use `kairos export`\n\n## Preflight Dependencies\n\nVerify before execution:\n\n1. `kairos` CLI is installed and callable (`kairos --version`).\n2. Authentication is valid (`kairos token` returns a token without error).\n3. Target directory path exists and contains at least one `.md` file.\n4. If a space is specified, confirm it exists via `kairos spaces`.\n\nIf any check fails, stop and report the issue with remediation guidance.\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"kairos --version && kairos token > /dev/null 2>&1 && echo 'auth: ok'\",\"timeout_seconds\":15},\"required\":true}}\n```\n\n## Confirm Scope\n\nPresent the batch operation details to the user:\n\n1. **Source directory** — absolute path.\n2. **File count** — number of `.md` files found (recursive or flat).\n3. **Target space** — personal (default) or a named group space.\n4. **Force mode** — whether `--force` will be used (overwrites existing).\n5. **Model attribution** — which `--model` value to use.\n\nList the files that will be trained and ask for confirmation.\n\n```json\n{\"contract\":{\"type\":\"user_input\",\"user_input\":{\"prompt\":\"Confirm batch scope: directory, file list, target space, force mode, and model ID\"},\"required\":true}}\n```\n\n## Validate Structure\n\nBefore training, validate each `.md` file against KAIROS adapter requirements:\n\n- Has an H1 title.\n- First H2 is \"Activation Patterns\".\n- Last H2 is \"Reward Signal\".\n- Contains at least one fenced `json` block with a top-level `contract` object.\n- Does not exceed 350 lines.\n\nReport any files that fail validation. Ask user whether to:\n- skip invalid files and proceed with valid ones\n- abort and fix issues first\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"echo 'Validation complete — see output above for results'\",\"timeout_seconds\":30},\"required\":true}}\n```\n\n## Execute Bulk Train\n\nRun the batch train operation using the KAIROS CLI:\n\n```\nkairos train <directory> --recursive --model <model> --space <space> [--force]\n```\n\nIf the directory contains files that should NOT be trained (README, reference\ndocs), either:\n- train file-by-file for the valid subset, or\n- move non-adapter files out before running `--recursive`\n\nCapture stdout and stderr. The CLI reports per-file status.\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"kairos train <directory> --recursive --model <model_id> --space <space>\",\"timeout_seconds\":120},\"required\":true}}\n```\n\n## Report Results\n\nSummarise the batch outcome:\n\n| Metric | Value |\n|--------|-------|\n| Files attempted | N |\n| Successfully trained | N |\n| Failed | N |\n| Skipped (invalid) | N |\n\nFor each failure, report:\n- File path\n- Error message\n- Suggested fix\n\nIf all succeeded, confirm adapter URIs are accessible via `kairos spaces`.\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":80},\"required\":true}}\n```\n\n## Reward Signal\n\nProtocol complete when:\n- All valid adapter files in the target directory have been trained to the\n specified space.\n- Per-file results have been reported to the user.\n- Any failures have been documented with remediation guidance.\n\nA successful bulk insert means the user's local protocol library is now\nregistered in KAIROS and available for activation by AI agents.\n",
|
|
35
|
+
"skill-format-guide": "---\nversion: \"4.6.2\"\nslug: skill-format-guide\ntitle: Skill Format and Local Authoring Guide\n---\n\n\n\n# Skill Format and Local Authoring Guide\n\nDecision rules for authoring SKILL.md files, choosing between local (git) and\nserver (KAIROS) storage, and quality gates for skill content. Loaded by\nprotocol-authoring agents during drafting and review when the output format is\n`skill`.\n\n## Activation Patterns\n\n**Typically invoked by:** `create-new-protocol` and\n`create-new-protocol-review`.\n\n**Can be invoked directly when agent needs:**\n- \"SKILL.md format reference\" / \"how to write a skill\"\n- \"skill vs adapter\" / \"local skill or KAIROS adapter\"\n- \"skill quality gates\" / \"SKILL.md structure\"\n- \"project-level skill\" / \"where to put a skill\"\n\n**Trigger pattern:** **skill** + (format | structure | guide | quality | local).\n\n**Must Never:**\n- Be used as an execution protocol.\n- Recommend storing a skill in both git AND KAIROS server simultaneously.\n- Confuse SKILL.md (agent instruction file) with protocol markdown (adapter).\n\n**Must Always:**\n- Be consulted before writing any SKILL.md file.\n- Enforce single source of truth: each skill lives in exactly one place.\n- Match storage location to the skill's scope and discoverability needs.\n\n**Good trigger examples:**\n- drafting a new skill and need format rules → load this\n- reviewing a SKILL.md for quality → load this\n- deciding local vs server for a skill → load this\n\n**Bad trigger examples:**\n- \"which challenge type for this step?\" → use `challenge-type-guide`\n- \"create a new protocol\" → use `create-new-protocol`\n\n## Storage Decision\n\nEvery skill has ONE home. Choose at authoring time. Never both.\n\n| Scope | Storage | Discovery | Source of Truth |\n|---|---|---|---|\n| Project-specific (deploy, test, release) | Git: `.agents/skills/{name}/` or `.cursor/skills/{name}/` | IDE host scans description field | Git repo |\n| Personal cross-project (universal) | KAIROS server via `train` | `activate` embedding search | KAIROS server |\n| Team/group shared | KAIROS server (group space) | `activate` | KAIROS server |\n\n### Decision Tree\n\n```\nIs this skill specific to ONE project's codebase?\n ├─ YES → Does it reference repo files, paths, or project-specific tools?\n │ ├─ YES → LOCAL (git)\n │ └─ NO → Could it help in other projects?\n │ ├─ YES → SERVER (KAIROS)\n │ └─ NO → LOCAL (git)\n └─ NO → SERVER (KAIROS)\n```\n\n### Local Storage Paths\n\n| Host | Path | Scope |\n|---|---|---|\n| Cursor IDE (project) | `.cursor/skills/{name}/SKILL.md` | Repo-scoped, git-controlled |\n| Cursor IDE (personal) | `~/.cursor/skills/{name}/SKILL.md` | User-wide, all projects |\n| Claude Code (project) | `.agents/skills/{name}/SKILL.md` | Repo-scoped, git-controlled |\n| Claude Code (personal) | `~/.agents/skills/{name}/SKILL.md` | User-wide, all projects |\n\n**Never** create skills in `~/.cursor/skills-cursor/` — reserved for system.\n\n### Promotion and Demotion\n\n**Local → Server (skill graduates to universal):**\n1. Read existing SKILL.md\n2. Optionally wrap in protocol structure (Activation Patterns, contracts)\n3. `train` to KAIROS server\n4. Delete local copy or mark deprecated\n5. Git commit the deletion\n\n**Server → Local (adapter becomes project-specific):**\n1. `export` with `format: skill_zip` or `format: markdown`\n2. Write to `.agents/skills/{slug}/SKILL.md`\n3. Optionally `delete` from server\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## SKILL.md Structure Rules\n\n### Required YAML Frontmatter\n\n```yaml\n---\nname: lowercase-hyphenated-name\ndescription: >-\n Third-person description of WHAT it does and WHEN to use it.\n Include trigger terms. Max 1024 chars.\n---\n```\n\n| Field | Constraint | Purpose |\n|---|---|---|\n| `name` | Max 64 chars, `[a-z0-9-]` only | Unique identifier |\n| `description` | Non-empty, max 1024 chars | Discovery by IDE and agents |\n| `disable-model-invocation` | Boolean, default `true` | Explicit load only |\n\n### Body Structure\n\n```markdown\n# Skill Title\n\n## Instructions\n[Core workflow — step-by-step, imperative voice]\n\n## Examples\n[Concrete usage examples with inputs and expected outputs]\n\n## Additional Resources\n- [reference.md](reference.md) — detailed documentation (optional)\n- [scripts/helper.sh](scripts/helper.sh) — utility scripts (optional)\n```\n\n### Directory Layout\n\n```\nskill-name/\n├── SKILL.md # Required\n├── SHA256SUMS # Required for KAIROS-exported skills\n├── reference.md # Optional — detailed docs\n├── examples.md # Optional — usage examples\n└── scripts/ # Optional — utility scripts\n └── validate.sh\n```\n\n### Size and Depth Limits\n\n- **SKILL.md body:** under 500 lines\n- **Reference depth:** one level only (SKILL.md → reference.md, never deeper)\n- **Progressive disclosure:** essential info in SKILL.md, details in references\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Quality Gates\n\n### Description Quality\n\nThe description is the primary discovery mechanism. It must:\n\n1. Be written in **third person** (not \"I can help\" or \"you can use\")\n2. State **WHAT** the skill does (specific capabilities)\n3. State **WHEN** to use it (trigger scenarios, file patterns, keywords)\n4. Include **trigger terms** that match real user language\n5. Avoid vague words: \"helps with\", \"assists\", \"various\"\n\n**Good:**\n```yaml\ndescription: >-\n Validate and publish Confluence pages managed as local markdown via Mark CLI.\n Use when the user asks to dry-run, validate, publish, or sync a Confluence\n page, or when working with files under confluence/ that have Mark metadata.\n```\n\n**Bad:**\n```yaml\ndescription: Helps with Confluence stuff.\n```\n\n### Content Quality\n\n| Check | Rule |\n|---|---|\n| Consistent terminology | One term per concept throughout |\n| No time-sensitive info | No \"before August 2025\" conditions |\n| Concrete examples | Real inputs/outputs, not abstract |\n| Actionable instructions | Agent knows what to DO, not just what exists |\n| Default tool choice | One recommended tool, escape hatch for alternatives |\n| No Windows paths | Forward slashes only |\n\n### Degree of Freedom\n\nMatch instruction specificity to the task's fragility:\n\n| Level | When | Example |\n|---|---|---|\n| High (text guidelines) | Multiple valid approaches | Code review guidelines |\n| Medium (templates/pseudocode) | Preferred pattern, acceptable variation | Report generation |\n| Low (exact scripts) | Fragile operations, consistency critical | DB migrations |\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Finalisation Paths\n\n### Path A: Local Write (project-level skill)\n\nWhen `{target}=local`:\n\n1. Determine output path from scope:\n - Project Cursor: `.cursor/skills/{name}/SKILL.md`\n - Project Claude: `.agents/skills/{name}/SKILL.md`\n - Personal: `~/.cursor/skills/{name}/SKILL.md` or `~/.agents/skills/{name}/`\n2. Create directory if needed\n3. Write SKILL.md with frontmatter and body\n4. Generate `SHA256SUMS` (GNU sha256sum format, paths relative to skill dir)\n5. Write any reference files and scripts\n6. Verify: `test -f \"{path}/SKILL.md\" && wc -l \"{path}/SKILL.md\"`\n7. Report path and line count to user\n\nDo NOT call `train`. The skill lives only in git.\n\n### Path B: Server Train (KAIROS-routable adapter)\n\nWhen `{target}=server`:\n\n1. Wrap skill content in protocol markdown if needed:\n - Add Activation Patterns (first H2)\n - Add contract blocks per layer\n - Add Reward Signal (last H2)\n2. Call `train` with full markdown\n3. Verify adapter URI returned\n4. Report URI and slug to user\n\nDo NOT write to local disk. The adapter lives only in KAIROS.\n\n### Path C: Hybrid Authoring (skill that is also an adapter)\n\nWhen `{target}=hybrid` (rare — use only when explicitly requested):\n\n1. Author as a KAIROS protocol (Activation Patterns, contracts, Reward Signal)\n2. `train` to server\n3. `export` with `format: skill_zip` to produce local SKILL.md bundle\n4. The exported SKILL.md is a **read-only derived artifact**, not a source of truth\n5. Document in the SKILL.md header that it was exported from KAIROS\n\n```json\n{\"contract\":{\"type\":\"comment\",\"comment\":{\"min_length\":30},\"required\":true}}\n```\n\n## Reward Signal\n\nOnly reachable after all prior steps are solved.\n\nThe agent can now:\n1. Choose the correct storage location for a skill\n2. Author SKILL.md with valid frontmatter and structure\n3. Apply quality gates to descriptions and content\n4. Finalize via local write OR server train (never both)\n5. Produce SHA256SUMS for integrity verification\n"
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,y as t}from"./vendor-ClAEfXKY.js";import{t as n}from"./react-C0Fs0kvo.js";import{n as r,r as i,t as a}from"./index-
|
|
1
|
+
import{g as e,y as t}from"./vendor-ClAEfXKY.js";import{t as n}from"./react-C0Fs0kvo.js";import{n as r,r as i,t as a}from"./index-Dc6y0Jxd.js";import{t as o}from"./api-LeOailEO.js";async function s(){let e=await o(`/api/me`);if(!e.ok){let t=await e.json().catch(()=>({})),n=Error(t.message??e.statusText);throw n.statusCode=e.status,n}return e.json()}function c(){return e({queryKey:[`me`],queryFn:s,retry:!1})}var l=n(),u={light:`account.themeOptionLight`,dark:`account.themeOptionDark`};function d(e){if(e.name&&e.name.trim().length>0)return e.name;let t=[e.given_name,e.family_name].filter(e=>typeof e==`string`&&e.trim().length>0);return t.length>0?t.join(` `):e.preferred_username&&e.preferred_username.length>0?e.preferred_username:e.sub}function f(){let{t:e}=t(),{data:n,isLoading:o,isError:s}=c(),{preference:f,setPreference:p}=i();return o?(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.loading`)}):s||!n?(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-4`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)]`,children:e(`account.notSignedIn`)}),(0,l.jsx)(`a`,{href:`/auth/callback`,className:`mt-4 min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium bg-[var(--color-primary)] text-white no-underline hover:bg-[var(--color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.signIn`)})]}):(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-[var(--color-text-heading)] text-2xl font-semibold mb-6`,children:e(`account.title`)}),(0,l.jsx)(`p`,{className:`text-[var(--color-text-muted)] mb-6`,children:e(`account.intro`)}),(0,l.jsxs)(`div`,{className:`rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface-elevated)] p-6`,children:[(0,l.jsxs)(`div`,{className:`mb-6 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-4`,children:[(0,l.jsx)(`h2`,{className:`mb-1 text-base font-semibold text-[var(--color-text-heading)]`,children:e(`account.themeTitle`)}),(0,l.jsx)(`p`,{className:`mb-3 text-sm text-[var(--color-text-muted)]`,children:e(`account.themeDescription`)}),(0,l.jsx)(`label`,{htmlFor:`account-theme-preference`,className:`sr-only`,children:e(`account.themePreferenceLabel`)}),(0,l.jsxs)(`select`,{id:`account-theme-preference`,value:f,onChange:e=>{let t=e.target.value;r(t)&&p(t)},className:`min-h-[44px] w-full max-w-xs rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-2 text-[var(--color-text)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:[(0,l.jsx)(`option`,{value:`system`,children:e(`account.themeOptionSystem`)}),a.map(t=>(0,l.jsx)(`option`,{value:t,children:e(u[t])},t))]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.name`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:d(n)})]}),n.preferred_username&&n.preferred_username!==d(n)&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.username`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.preferred_username})]}),n.email&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.email`)}),(0,l.jsxs)(`span`,{className:`text-[var(--color-text-heading)]`,children:[n.email,n.email_verified===!0?` (${e(`account.emailVerified`)})`:``]})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.accountType`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.account_label})]}),(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.realm`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.realm})]}),n.identity_provider&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.identityProvider`)}),(0,l.jsx)(`span`,{className:`text-[var(--color-text-heading)]`,children:n.identity_provider})]}),n.groups.length>0&&(0,l.jsxs)(`div`,{className:`mb-4`,children:[(0,l.jsx)(`span`,{className:`block text-xs uppercase tracking-wider text-[var(--color-text-muted)] mb-1`,children:e(`account.groups`)}),(0,l.jsx)(`ul`,{className:`list-disc list-inside text-[var(--color-text-heading)] space-y-1`,children:n.groups.map(e=>(0,l.jsx)(`li`,{children:e},e))})]}),(0,l.jsx)(`div`,{className:`mt-6 flex gap-2 flex-wrap`,children:(0,l.jsx)(`a`,{href:`/auth/logout`,className:`min-h-[44px] min-w-[44px] inline-flex items-center justify-center px-4 py-2 rounded-[var(--radius-md)] font-medium border border-[var(--color-border)] text-[var(--color-text)] bg-transparent no-underline hover:bg-[var(--color-surface-elevated)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] focus-visible:outline-offset-2`,children:e(`account.logOut`)})})]})]})}export{f as AccountPage};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-7MMXUrXk.js","assets/vendor-ClAEfXKY.js","assets/rolldown-runtime-QTnfLwEv.js","assets/tiptap-C_4sNILg.js","assets/react-C0Fs0kvo.js","assets/SpaceSelect-Cy0r_Jt1.js","assets/api-LeOailEO.js","assets/SurfaceCard-JVbzWQ6r.js","assets/KairosPage-CnWzMtuL.js","assets/ErrorAlert-CYPZ3Bqf.js","assets/RunsPage-BIxrAgbr.js","assets/useRunSession-yeTImsfh.js","assets/ProtocolEditPage-DsynsLIp.js","assets/ChallengeCard-dY7Uf6rM.js","assets/RichTextEditor-DAs784S1.js","assets/export-skill-zip-BT5rlYN-.js","assets/RunGuidedPage-CouSFieR.js","assets/StepFlowGraph-BLkRTpUE.js","assets/SkillBundlePage-CI2sUUZc.js","assets/ProtocolDetailPage-B9kWB6w1.js","assets/AccountPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-7MMXUrXk.js","assets/vendor-ClAEfXKY.js","assets/rolldown-runtime-QTnfLwEv.js","assets/tiptap-C_4sNILg.js","assets/react-C0Fs0kvo.js","assets/SpaceSelect-Cy0r_Jt1.js","assets/api-LeOailEO.js","assets/SurfaceCard-JVbzWQ6r.js","assets/KairosPage-CnWzMtuL.js","assets/ErrorAlert-CYPZ3Bqf.js","assets/RunsPage-BIxrAgbr.js","assets/useRunSession-yeTImsfh.js","assets/ProtocolEditPage-DsynsLIp.js","assets/ChallengeCard-dY7Uf6rM.js","assets/RichTextEditor-DAs784S1.js","assets/export-skill-zip-BT5rlYN-.js","assets/RunGuidedPage-CouSFieR.js","assets/StepFlowGraph-BLkRTpUE.js","assets/SkillBundlePage-CI2sUUZc.js","assets/ProtocolDetailPage-B9kWB6w1.js","assets/AccountPage-BtIFPwUM.js","assets/NotFoundPage-Bj688VA0.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{_ as t,b as n,c as r,i,l as a,m as o,o as s,s as c,u as l,v as u,x as d,y as f}from"./vendor-ClAEfXKY.js";import{i as p,n as m,t as h}from"./react-C0Fs0kvo.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),d.use(n).init({lng:`en`,fallbackLng:`en`,ns:[`translation`],defaultNS:`translation`,resources:{en:{translation:{"nav.home":`Home`,"nav.kairos":`Browse`,"nav.create":`Create`,"nav.runs":`Test Run`,"nav.account":`Account`,"layout.kairosVersion":`KAIROS v{{version}}`,skipToMain:`Skip to main content`,"home.title":`Home`,"home.tagline":`Start from a clear task: browse protocols, create a new workflow, or continue protocol testing.`,"home.findCardTitle":`Find the right protocol`,"home.findCardSubtitle":`Home stays lightweight. Search and deeper discovery live in Browse.`,"home.goToBrowse":`Go to Browse`,"home.cardBrowseTitle":`Browse protocols`,"home.cardBrowseSubtitle":`Search or browse by label.`,"home.cardBrowseCta":`Open Browse`,"home.cardCreateTitle":`Create protocol`,"home.cardCreateSubtitle":`Use the rendered editor to draft a new workflow.`,"home.cardCreateCta":`Create new`,"home.cardRunsTitle":`Test Run`,"home.cardRunsSubtitle":`Resume a saved test run from this device.`,"home.cardRunsCta":`Open Test Run`,"home.spacesHeading":`Spaces`,"home.searchLabel":`Search protocols`,"home.searchPlaceholder":`e.g. deploy and test`,"home.searchHint":`Enter a query to find the best matching protocol. Results open in Browse.`,"home.statsLabel":`Space and protocol counts`,"home.stats.personalProtocols":`—`,"home.stats.personalProtocolsLabel":`Personal protocols`,"home.stats.kairosApp":`—`,"home.stats.kairosAppLabel":`Kairos app`,"home.stats.spaces":`—`,"home.stats.spacesLabel":`Spaces`,"home.stats.protocolCount":`{{count}} protocol`,"home.stats.protocolCount_plural":`{{count}} protocols`,"home.ctaPre":`Search and manage protocols in`,"home.ctaSuffix":`.`,"kairos.title":`Browse`,"kairos.searchLabel":`Activation query`,"kairos.searchPlaceholder":`e.g. deploy and test`,"kairos.searchHint":`Search or browse by label. The default view lists protocols by their label.`,"kairos.searchHintShort":`Run an activation query to rank the best matches, or browse the list below.`,"kairos.browseByLabel":`Browse by label`,"kairos.browseByLetterHint":`Click a letter to list protocols whose title starts with that letter (A–Z).`,"kairos.letterCount":`Letter {{letter}}, {{count}} protocols`,"kairos.labelsStartingWith":`Labels starting with {{letter}}`,"kairos.noLabelsForLetter":`No protocols starting with this letter.`,"kairos.browseFlatListHint":`Protocols listed by label. This is the default view when you open Browse.`,"kairos.browseEmpty":`No protocols found in your spaces yet.`,"kairos.enterQueryHint":`Enter an activation query above to find the best matching protocol. Results appear below.`,"spaces.filterAll":`All spaces`,"spaces.type.personal":`Personal`,"spaces.type.group":`Group`,"spaces.type.app":`App`,"spaces.type.other":`Other`,"kairos.scopeSpaceLabel":`Limit search to a space`,"kairos.spaceLabel":`Space`,"kairos.search":`Activate`,"kairos.loading":`Activating…`,"kairos.empty":`No matching protocols found`,"kairos.foundMatches":`Found {{count}} activation choices (top confidence: {{top}}%). View one, refine the query, or create a new protocol.`,"kairos.resultsLabel":`Activation results`,"kairos.score":`Score`,"kairos.version":`Version`,"kairos.tagsLabel":`Tags`,"kairos.refineMeta":`Refine query`,"kairos.createMeta":`Start from scratch`,"kairos.view":`View`,"kairos.viewProtocol":`View {{title}}`,"kairos.refineSearch":`Refine query`,"kairos.createNew":`Create new`,"protocol.loading":`Loading protocol…`,"protocol.notFound":`Protocol not found`,"protocol.uri":`URI`,"protocol.spaceLabel":`Space`,"protocol.readOnly":`Read-only`,"protocol.copyUri":`Copy URI`,"protocol.download":`Download`,"protocol.downloadAsMarkdown":`Download as Markdown`,"protocol.downloadAsSkill":`Download as Skill`,"protocol.editAsSkill":`Edit as Skill`,"protocol.expand":`Expand`,"protocol.collapse":`Collapse`,"protocol.edit":`Edit`,"protocol.duplicate":`Duplicate`,"protocol.runGuided":`Test Run`,"protocol.steps":`Steps`,"protocol.stepFlow":`Step flow`,"protocol.exportCardTitle":`Export`,"protocol.exportCardSubtitle":`Clear language replaces internal dump terminology.`,"protocol.exportFooter":`Skill export prepares a portable bundle for external AI tools.`,"protocol.triggers":`Activation patterns`,"protocol.completion":`Reward signal`,"protocol.howToUse":`How to use this protocol`,"protocol.howToUseInProduct":`The public UI helps people read, edit, export, and manually test protocol steps. Live AI execution still happens through MCP or CLI tooling.`,"protocol.howToUseCopy":`Use Test Run from the button above to step through this protocol in the browser. For agents or CLI, use Cursor (MCP) or the command line. See`,"protocol.docsLink":`documentation`,"runs.title":`Test Run`,"runs.subtitle":`Continue a test run you started earlier on this device.`,"runs.empty":`No runs yet.`,"runs.listLabel":`Test Run list`,"runs.status":`Status`,"runs.updated":`Updated`,"runs.stepsDone":`{{count}} steps completed`,"runs.resume":`Resume`,"runs.remove":`Remove`,"run.title":`Test Run`,"run.guidedIntro":`Step through the saved run in the browser and submit the same data the current run flow expects.`,"run.progressHeading":`Progress`,"run.currentStepHeading":`Current step`,"run.challengeHeading":`Challenge`,"run.stepProgress":`Step {{current}} of {{total}}`,"run.sessionBadge":`Active manual test session`,"run.flowStepN":`{{n}}`,"run.copyShellCommand":`Copy command`,"run.adapterUri":`Adapter URI`,"run.backToProtocol":`Back to adapter`,"run.start":`Start run`,"run.starting":`Starting…`,"run.safety.title":`Safe by default`,"run.safety.copy":`This guided run never executes shell commands in your browser. For shell challenges, run the command yourself and paste the real results.`,"run.serverMessage":`Server message`,"run.currentLayer":`Current layer`,"run.layerUri":`Layer URI`,"run.noLayerContent":`(No layer content)`,"run.contract":`Contract`,"run.contractType":`Type`,"run.advanced":`Advanced`,"run.nonce":`Nonce`,"run.proofHash":`Challenge proof_hash`,"run.previousProofHash":`Previous proof_hash`,"run.copy":`Copy`,"run.copied":`Copied`,"run.solution":`Solution`,"run.solutionFormLabel":`Submit solution`,"run.submitStep":`Submit step`,"run.shell.command":`Command`,"run.shell.invocation":`Invocation`,"run.shell.exitCode":`Exit code`,"run.shell.stdout":`Stdout`,"run.shell.stderr":`Stderr`,"run.mcp.toolName":`Tool`,"run.mcp.toolMissing":`(Missing tool name)`,"run.mcp.success":`Success`,"run.mcp.arguments":`Arguments (JSON)`,"run.mcp.result":`Result (JSON)`,"run.userInput.prompt":`Prompt`,"run.userInput.promptMissing":`(Missing prompt)`,"run.userInput.confirmation":`User confirmation`,"run.comment.minLength":`Minimum {{count}} characters`,"run.comment.count":`{{count}} typed`,"run.comment.text":`Comment`,"run.reward.title":`Reward completion`,"run.reward.subtitle":`Finalize the run outcome for reward and export quality.`,"run.reward.outcomeLabel":`Outcome`,"run.reward.success":`Success`,"run.reward.failure":`Failure`,"run.reward.feedback":`Feedback`,"run.reward.submit":`Submit reward`,"run.reward.submitting":`Submitting…`,"run.reward.defaultFeedback":`Completed guided run.`,"run.stepperProgress":`{{completed}} step(s) completed`,"run.history":`History`,"run.historyLabel":`Run history`,"run.completed":`Run completed`,"run.missingUri":`Missing adapter URI.`,"protocolEdit.newTitle":`New protocol`,"protocolEdit.editTitle":`Edit protocol`,"protocolEdit.hint":`Write as a human. The editor renders text on input and output while keeping the saved format compatible with generic Markdown.`,"protocolEdit.stepHeading":`Step {{n}}`,"protocolEdit.stepEditorHint":`Human-friendly editor with Markdown-safe formatting.`,"protocolEdit.triggersEditorHint":`Shown to humans as rendered text and serialized as Markdown-compatible content.`,"protocolEdit.previewRenderedTitle":`Rendered preview`,"protocolEdit.previewRenderedSubtitle":`Reading flow is fully rendered. Editing keeps a Markdown-safe rich text surface and this card previews section structure.`,"protocolEdit.previewStepLine":`Step {{n}}: {{label}}`,"protocolEdit.skillShortcutTitle":`Skill bundle shortcut`,"protocolEdit.skillShortcutSubtitle":`Authors can turn a protocol into a reusable skill bundle without learning repo-internal file names.`,"protocolEdit.formLabel":`Protocol form`,"protocolEdit.protocolLabel":`Protocol label`,"protocolEdit.triggersLabel":`Activation patterns`,"protocolEdit.triggersHint":`Describe when this protocol should run (e.g. deploy and test).`,"protocolEdit.stepLabel":`Step label`,"protocolEdit.stepContent":`Step content`,"protocolEdit.challengeType":`Challenge type`,"protocolEdit.addStep":`Add step`,"protocolEdit.removeStep":`Remove step`,"protocolEdit.completionLabel":`Reward signal`,"protocolEdit.challengeShell":`Shell command`,"protocolEdit.challengeMcp":`MCP tool call`,"protocolEdit.challengeUserInput":`User input`,"protocolEdit.challengeComment":`Comment`,"protocolEdit.shellCmd":`Command`,"protocolEdit.shellTimeout":`Timeout (seconds)`,"protocolEdit.shellInterpreter":`Interpreter (optional)`,"protocolEdit.shellFlags":`Flags (one per line, optional)`,"protocolEdit.shellArgs":`Args (one per line, optional)`,"protocolEdit.shellWorkdir":`Workdir (optional)`,"protocolEdit.mcpToolName":`Tool name`,"protocolEdit.userInputPrompt":`Prompt`,"protocolEdit.commentMinLength":`Minimum length (characters)`,"protocolEdit.importCardTitle":`Import existing content`,"protocolEdit.uploadHint":"Uploading a `.md` file fills this editor form. It does not publish or overwrite anything until you save.","protocolEdit.contentLabel":`Protocol content (markdown)`,"protocolEdit.previewLabel":`Protocol preview`,"protocolEdit.previewTitle":`Live preview`,"protocolEdit.previewSteps":`Steps`,"protocolEdit.previewNoSteps":`No steps yet.`,"protocolEdit.previewSections":`Key sections`,"protocolEdit.present":`present`,"protocolEdit.missing":`missing`,"protocolEdit.insertTemplate":`Insert template`,"protocolEdit.upload":`Upload .md file`,"skill.title":`Edit as Skill`,"skill.subtitle":`Prepare a skill bundle for external AI tools before downloading the zip. Protocol content stays connected to the original workflow.`,"skill.bundleContentsTitle":`Bundle contents`,"skill.bundleContentsSubtitle":`Optional protocol references can be included in a dedicated folder.`,"skill.chipReadme":`Include README snippet`,"skill.chipPrompts":`Include example prompts`,"skill.comingSoon":`Coming soon`,"skill.bundlePreviewTitle":`Bundle preview`,"skill.bundlePreviewSubtitle":`Zip root contains the skill folder so users can upload it directly.`,"skill.whyExportTitle":`Why this export exists`,"skill.whyExportSubtitle":`The bundle is for human-friendly reuse, not an internal raw dump.`,"skill.whyExportBody":`Authors can package a protocol as a portable skill with polished naming and usage guidance, then download the final zip in one step.`,"skill.skillName":`Skill name`,"skill.description":`Skill description`,"skill.descriptionHint":`Describe what the skill does and when an AI assistant should use it.`,"skill.whenToUse":`When to use it`,"skill.includeReferences":`Include references folder`,"skill.downloadAsSkill":`Download as Skill`,"skill.backToProtocol":`Back to protocol`,"protocolEdit.placeholder":`# Protocol title
|
|
3
3
|
|
|
4
4
|
## Activation Patterns
|
|
5
5
|
...
|
|
6
6
|
|
|
7
7
|
## Step 1
|
|
8
|
-
...`,"protocolEdit.contentHint":`Include: Activation Patterns (first H2), steps (H2 + optional challenge block), Reward Signal (last H2).`,"protocolEdit.targetSpaceLabel":`Save to space`,"protocolEdit.targetSpaceHint":`New protocols are stored in the space you pick (default: Personal).`,"protocolEdit.forkSourceLabel":`Fork from adapter (optional)`,"protocolEdit.forkSourcePlaceholder":`kairos://adapter/{slug}`,"protocolEdit.forkSourceHint":`Leave empty for a brand-new protocol, or paste an adapter URI to copy its markdown into the target space as a new adapter.`,"protocolEdit.forkUriInvalid":`Fork source must be a kairos://adapter/{slug} URI.`,"protocolEdit.moveSpaceLabel":`Space for this protocol`,"protocolEdit.moveSpaceHint":`Change the space and save to move every layer to the selected space (same as tune with a space parameter).`,"protocolEdit.save":`Save`,"protocolEdit.saving":`Saving…`,"protocolEdit.cancel":`Cancel`,"account.title":`Account`,"account.intro":`You are signed in. Sign out below or use the options to manage your profile.`,"account.loading":`Loading…`,"account.notSignedIn":`You are not signed in.`,"account.signIn":`Sign in`,"account.name":`Name`,"account.username":`Username`,"account.email":`Email`,"account.emailVerified":`verified`,"account.accountType":`Account type`,"account.realm":`Realm`,"account.identityProvider":`Login provider`,"account.groups":`Groups`,"account.themeTitle":`Theme`,"account.themeDescription":`Choose how KAIROS UI appearance should be rendered.`,"account.themePreferenceLabel":`Theme preference`,"account.themeOptionLight":`Light`,"account.themeOptionDark":`Dark`,"account.themeOptionSystem":`Match system`,"account.logOut":`Log out`,"notFound.title":`Page not found`,"notFound.message":`The page you requested could not be found.`,"notFound.goHome":`Go to Home`,"error.title":`Something went wrong`,"error.retry":`Retry`,"error.goBack":`Go to Home`,"error.support":`Support`}}},interpolation:{escapeValue:!1}});var g=e(p(),1),_=m(),v=`/ui/assets/kairos-mcp-DNiKVgiO.svg`,y=h(),b=e=>e.startsWith(`/protocols`)||e.startsWith(`/runs`);function x(){let{t:e}=f(),t=l().pathname,n=({isActive:e})=>`min-h-[var(--layout-touch-target)] flex items-center px-4 py-3 text-[var(--color-text)] no-underline border-l-[3px] border-transparent outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-heading)] ${e?`font-semibold text-[var(--color-primary)] border-l-[var(--color-primary)] bg-[var(--color-surface)]`:``}`,r=b(t)?`min(100%, var(--layout-main-max), var(--layout-main-wide))`:`min(100%, var(--layout-main-max), var(--layout-main-narrow))`;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{href:`#main`,className:`skip-link`,children:e(`skipToMain`)}),(0,y.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,y.jsxs)(`aside`,{className:`flex min-h-screen w-[var(--layout-sidebar-width)] flex-shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface-elevated)] py-4`,"aria-label":`Main navigation`,children:[(0,y.jsx)(`div`,{className:`px-4 pb-4`,children:(0,y.jsxs)(s,{to:`/`,end:!0,className:`flex min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] items-center gap-3 rounded-md outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`,children:[(0,y.jsx)(`img`,{src:v,alt:``,className:`h-10 w-10 flex-shrink-0 rounded-lg object-contain`,width:`40`,height:`40`}),(0,y.jsxs)(`span`,{className:`flex flex-col leading-tight`,children:[(0,y.jsx)(`span`,{className:`font-bold text-[var(--color-text-heading)] text-lg`,children:`Kairos`}),(0,y.jsx)(`span`,{className:`font-bold text-[var(--color-text-muted)] text-xs uppercase tracking-wide`,children:`MCP`})]})]})}),(0,y.jsxs)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5`,children:[(0,y.jsx)(s,{to:`/`,end:!0,"aria-current":t===`/`?`page`:void 0,className:n,children:e(`nav.home`)}),(0,y.jsx)(s,{to:`/kairos`,"aria-current":t===`/kairos`?`page`:void 0,className:n,children:e(`nav.kairos`)}),(0,y.jsx)(s,{to:`/protocols/new`,"aria-current":t===`/protocols/new`?`page`:void 0,className:n,children:e(`nav.create`)}),(0,y.jsx)(s,{to:`/runs`,"aria-current":t===`/runs`?`page`:void 0,className:n,children:e(`nav.runs`)}),(0,y.jsx)(s,{to:`/account`,"aria-current":t===`/account`?`page`:void 0,className:n,children:e(`nav.account`)})]}),(0,y.jsx)(`div`,{className:`mt-auto border-t border-[var(--color-border)] px-4 pt-3`,children:(0,y.jsx)(`p`,{className:`m-0 text-xs text-[var(--color-text-muted)]`,children:e(`layout.kairosVersion`,{version:`4.6.
|
|
8
|
+
...`,"protocolEdit.contentHint":`Include: Activation Patterns (first H2), steps (H2 + optional challenge block), Reward Signal (last H2).`,"protocolEdit.targetSpaceLabel":`Save to space`,"protocolEdit.targetSpaceHint":`New protocols are stored in the space you pick (default: Personal).`,"protocolEdit.forkSourceLabel":`Fork from adapter (optional)`,"protocolEdit.forkSourcePlaceholder":`kairos://adapter/{slug}`,"protocolEdit.forkSourceHint":`Leave empty for a brand-new protocol, or paste an adapter URI to copy its markdown into the target space as a new adapter.`,"protocolEdit.forkUriInvalid":`Fork source must be a kairos://adapter/{slug} URI.`,"protocolEdit.moveSpaceLabel":`Space for this protocol`,"protocolEdit.moveSpaceHint":`Change the space and save to move every layer to the selected space (same as tune with a space parameter).`,"protocolEdit.save":`Save`,"protocolEdit.saving":`Saving…`,"protocolEdit.cancel":`Cancel`,"account.title":`Account`,"account.intro":`You are signed in. Sign out below or use the options to manage your profile.`,"account.loading":`Loading…`,"account.notSignedIn":`You are not signed in.`,"account.signIn":`Sign in`,"account.name":`Name`,"account.username":`Username`,"account.email":`Email`,"account.emailVerified":`verified`,"account.accountType":`Account type`,"account.realm":`Realm`,"account.identityProvider":`Login provider`,"account.groups":`Groups`,"account.themeTitle":`Theme`,"account.themeDescription":`Choose how KAIROS UI appearance should be rendered.`,"account.themePreferenceLabel":`Theme preference`,"account.themeOptionLight":`Light`,"account.themeOptionDark":`Dark`,"account.themeOptionSystem":`Match system`,"account.logOut":`Log out`,"notFound.title":`Page not found`,"notFound.message":`The page you requested could not be found.`,"notFound.goHome":`Go to Home`,"error.title":`Something went wrong`,"error.retry":`Retry`,"error.goBack":`Go to Home`,"error.support":`Support`}}},interpolation:{escapeValue:!1}});var g=e(p(),1),_=m(),v=`/ui/assets/kairos-mcp-DNiKVgiO.svg`,y=h(),b=e=>e.startsWith(`/protocols`)||e.startsWith(`/runs`);function x(){let{t:e}=f(),t=l().pathname,n=({isActive:e})=>`min-h-[var(--layout-touch-target)] flex items-center px-4 py-3 text-[var(--color-text)] no-underline border-l-[3px] border-transparent outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-heading)] ${e?`font-semibold text-[var(--color-primary)] border-l-[var(--color-primary)] bg-[var(--color-surface)]`:``}`,r=b(t)?`min(100%, var(--layout-main-max), var(--layout-main-wide))`:`min(100%, var(--layout-main-max), var(--layout-main-narrow))`;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{href:`#main`,className:`skip-link`,children:e(`skipToMain`)}),(0,y.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,y.jsxs)(`aside`,{className:`flex min-h-screen w-[var(--layout-sidebar-width)] flex-shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface-elevated)] py-4`,"aria-label":`Main navigation`,children:[(0,y.jsx)(`div`,{className:`px-4 pb-4`,children:(0,y.jsxs)(s,{to:`/`,end:!0,className:`flex min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] items-center gap-3 rounded-md outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`,children:[(0,y.jsx)(`img`,{src:v,alt:``,className:`h-10 w-10 flex-shrink-0 rounded-lg object-contain`,width:`40`,height:`40`}),(0,y.jsxs)(`span`,{className:`flex flex-col leading-tight`,children:[(0,y.jsx)(`span`,{className:`font-bold text-[var(--color-text-heading)] text-lg`,children:`Kairos`}),(0,y.jsx)(`span`,{className:`font-bold text-[var(--color-text-muted)] text-xs uppercase tracking-wide`,children:`MCP`})]})]})}),(0,y.jsxs)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5`,children:[(0,y.jsx)(s,{to:`/`,end:!0,"aria-current":t===`/`?`page`:void 0,className:n,children:e(`nav.home`)}),(0,y.jsx)(s,{to:`/kairos`,"aria-current":t===`/kairos`?`page`:void 0,className:n,children:e(`nav.kairos`)}),(0,y.jsx)(s,{to:`/protocols/new`,"aria-current":t===`/protocols/new`?`page`:void 0,className:n,children:e(`nav.create`)}),(0,y.jsx)(s,{to:`/runs`,"aria-current":t===`/runs`?`page`:void 0,className:n,children:e(`nav.runs`)}),(0,y.jsx)(s,{to:`/account`,"aria-current":t===`/account`?`page`:void 0,className:n,children:e(`nav.account`)})]}),(0,y.jsx)(`div`,{className:`mt-auto border-t border-[var(--color-border)] px-4 pt-3`,children:(0,y.jsx)(`p`,{className:`m-0 text-xs text-[var(--color-text-muted)]`,children:e(`layout.kairosVersion`,{version:`4.6.2`})})})]}),(0,y.jsx)(`main`,{id:`main`,className:`flex-1 mx-auto w-full py-[var(--layout-main-padding-y)] px-[var(--layout-main-padding-x)]`,style:{maxWidth:r},tabIndex:-1,children:(0,y.jsx)(c,{})})]})]})}var S=(0,g.lazy)(()=>o(()=>import(`./HomePage-7MMXUrXk.js`).then(e=>({default:e.HomePage})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),C=(0,g.lazy)(()=>o(()=>import(`./KairosPage-CnWzMtuL.js`).then(e=>({default:e.KairosPage})),__vite__mapDeps([8,2,1,3,4,9,5,6]))),w=(0,g.lazy)(()=>o(()=>import(`./RunsPage-BIxrAgbr.js`).then(e=>({default:e.RunsPage})),__vite__mapDeps([10,1,2,3,4,11]))),T=(0,g.lazy)(()=>o(()=>import(`./ProtocolEditPage-DsynsLIp.js`).then(e=>({default:e.ProtocolEditPage})),__vite__mapDeps([12,2,1,3,4,13,14,5,6,7,15]))),E=(0,g.lazy)(()=>o(()=>import(`./RunGuidedPage-CouSFieR.js`).then(e=>({default:e.RunGuidedPage})),__vite__mapDeps([16,2,1,3,4,13,9,17,7,11,6]))),D=(0,g.lazy)(()=>o(()=>import(`./SkillBundlePage-CI2sUUZc.js`).then(e=>({default:e.SkillBundlePage})),__vite__mapDeps([18,2,1,3,4,14,7,15,6]))),O=(0,g.lazy)(()=>o(()=>import(`./ProtocolDetailPage-B9kWB6w1.js`).then(e=>({default:e.ProtocolDetailPage})),__vite__mapDeps([19,2,1,3,4,13,17,7,15,6]))),k=(0,g.lazy)(()=>o(()=>import(`./AccountPage-BtIFPwUM.js`).then(e=>({default:e.AccountPage})),__vite__mapDeps([20,1,2,3,4,6]))),A=(0,g.lazy)(()=>o(()=>import(`./NotFoundPage-Bj688VA0.js`).then(e=>({default:e.NotFoundPage})),__vite__mapDeps([21,1,2,3,4,9])));function j(){return(0,y.jsx)(`div`,{className:`flex min-h-[12rem] items-center justify-center text-[var(--color-text-muted)]`,"aria-busy":`true`,children:`Loading…`})}function M(){return(0,y.jsx)(a,{children:(0,y.jsxs)(r,{path:`/`,element:(0,y.jsx)(x,{}),children:[(0,y.jsx)(r,{index:!0,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(S,{})})}),(0,y.jsx)(r,{path:`kairos`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(C,{})})}),(0,y.jsx)(r,{path:`runs`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(w,{})})}),(0,y.jsx)(r,{path:`protocols/new`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(T,{})})}),(0,y.jsx)(r,{path:`protocols/:uri/edit`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(T,{})})}),(0,y.jsx)(r,{path:`protocols/:uri/run`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(E,{})})}),(0,y.jsx)(r,{path:`protocols/:uri/skill`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(D,{})})}),(0,y.jsx)(r,{path:`protocols/:uri`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(O,{})})}),(0,y.jsx)(r,{path:`account`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(k,{})})}),(0,y.jsx)(r,{path:`*`,element:(0,y.jsx)(g.Suspense,{fallback:(0,y.jsx)(j,{}),children:(0,y.jsx)(A,{})})})]})})}function N(){return(0,y.jsx)(i,{basename:`/ui`,children:(0,y.jsx)(M,{})})}var P=[`light`,`dark`],F=`kairos:ui:theme-preference`,I=`(prefers-color-scheme: dark)`,L=`system`;function R(e){return e===null?!1:e===`system`?!0:P.includes(e)}function z(e,t){return e===`system`?t?`dark`:`light`:e}function B(){if(typeof window>`u`)return L;try{let e=window.localStorage.getItem(F);return R(e)?e:L}catch{return L}}function V(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(I).matches}function H(e){if(typeof document>`u`)return;let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e===`light`?`light`:`dark`}function U(){let[e,t]=(0,g.useState)(()=>B()),[n,r]=(0,g.useState)(()=>V()),i=(0,g.useMemo)(()=>z(e,n),[e,n]);return(0,g.useEffect)(()=>{H(i)},[i]),(0,g.useEffect)(()=>{if(typeof window>`u`||e!==`system`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(I);r(t.matches);let n=e=>{r(e.matches)};return typeof t.addEventListener==`function`?(t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)):(t.addListener(n),()=>t.removeListener(n))},[e]),(0,g.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`kairos:ui:theme-preference`&&t(R(e.newValue)?e.newValue:L)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{preference:e,effectiveTheme:i,setPreference:(0,g.useCallback)(e=>{if(t(e),!(typeof window>`u`))try{window.localStorage.setItem(F,e)}catch{}},[])}}var W=(0,g.createContext)(null);function G({children:e}){let t=U();return(0,y.jsx)(W.Provider,{value:t,children:e})}function K(){let e=(0,g.useContext)(W);if(!e)throw Error(`useThemePreferenceContext must be used within ThemeProvider`);return e}var q=new u;(0,_.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(g.StrictMode,{children:(0,y.jsx)(t,{client:q,children:(0,y.jsx)(G,{children:(0,y.jsx)(N,{})})})}));export{R as n,K as r,P as t};
|
package/dist/ui/index.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
root.style.colorScheme = theme;
|
|
27
27
|
})();
|
|
28
28
|
</script>
|
|
29
|
-
<script type="module" crossorigin src="/ui/assets/index-
|
|
29
|
+
<script type="module" crossorigin src="/ui/assets/index-Dc6y0Jxd.js"></script>
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/ui/assets/rolldown-runtime-QTnfLwEv.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/ui/assets/react-C0Fs0kvo.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/ui/assets/tiptap-C_4sNILg.js">
|
package/package.json
CHANGED