@debian777/kairos-mcp 4.2.2-rc.0 → 4.2.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/resources/embedded-mcp-resources.js +6 -6
- package/dist/resources/embedded-mcp-resources.js.map +1 -1
- package/dist/ui/assets/{AccountPage-TojJxGta.js → AccountPage-BoA6v1P5.js} +1 -1
- package/dist/ui/assets/{index-CXS27AR1.js → index-Da2yvncA.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
|
@@ -25,12 +25,12 @@ export const mcpResources = {
|
|
|
25
25
|
},
|
|
26
26
|
"mem": {},
|
|
27
27
|
"meta": {
|
|
28
|
-
"create-new-protocol": "---\nslug: create-new-protocol\nversion: \"4.2.2-rc.0\"\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## 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?\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\nEnsure `$KAIROS_WORK_DIR` is set (for example from the latest MCP response field `kairos_work_dir`) before writing files.\n\nProduce a structured gap report at\n`$KAIROS_WORK_DIR/protocol-review-findings.md`. For each finding include:\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**Protocol structure rules:**\n- H1: protocol title\n- First H2: Activation Patterns\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.2.2
|
|
30
|
-
"create-new-protocol-review": "---\nversion: \"4.2.2
|
|
31
|
-
"challenge-type-guide": "---\nversion: \"4.2.2
|
|
32
|
-
"phase-critic": "---\nversion: \"4.2.2
|
|
33
|
-
"protocol-linking-guide": "---\nversion: \"4.2.2
|
|
28
|
+
"create-new-protocol": "---\nslug: create-new-protocol\nversion: \"4.2.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## 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?\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\nEnsure `$KAIROS_WORK_DIR` is set (for example from the latest MCP response field `kairos_work_dir`) before writing files.\n\nProduce a structured gap report at\n`$KAIROS_WORK_DIR/protocol-review-findings.md`. For each finding include:\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**Protocol structure rules:**\n- H1: protocol title\n- First H2: Activation Patterns\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.2.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.2.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 a writable `$KAIROS_WORK_DIR` and `draft-protocol.md` under it (if your shell does not define the variable, export it from the latest `activate` / `forward` / `next` response field `kairos_work_dir`).\n- Skip format or stranger review.\n- Approve a draft merely because it sounds polished.\n\n**Must Always:**\n- Verify the work directory and draft file exist.\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## Prerequisites\n\nThis protocol requires a work directory (exported as `$KAIROS_WORK_DIR` in your shell) from the authoring adapter or from the server:\n- `$KAIROS_WORK_DIR/draft-protocol.md`\n- `$KAIROS_WORK_DIR/requirements.md` (optional)\n\nWhen using KAIROS MCP, each `activate`, `forward`, and `next` response includes `kairos_work_dir` with the canonical path the server uses; run `export KAIROS_WORK_DIR=\"<path>\"` before shell challenges if the variable is not already set.\n\nIf invoked directly, copy the draft file into `$KAIROS_WORK_DIR` before\nproceeding.\n\n**Security:** never write credentials, tokens, or secrets into\n`$KAIROS_WORK_DIR`.\n\n## Format Review [SUBAGENT]\n\nDelegate format verification to a subagent. The subagent writes its verdict to\n`$KAIROS_WORK_DIR/format-review.md`.\n\n**Input:** `$KAIROS_WORK_DIR/draft-protocol.md`\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 `;`\n5. Verify DRY, slug, and 350-line compliance.\n6. Write verdict to `$KAIROS_WORK_DIR/format-review.md`. First line MUST be\n `PASS` or `FAIL`. Remaining lines list concrete fixes.\n\n**Output:** `$KAIROS_WORK_DIR/format-review.md`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$KAIROS_WORK_DIR/format-review.md\\\" && head -1 \\\"$KAIROS_WORK_DIR/format-review.md\\\" | 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 `$KAIROS_WORK_DIR/stranger-review.md`.\n\n**Input:** `$KAIROS_WORK_DIR/draft-protocol.md`\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 `$KAIROS_WORK_DIR/stranger-review.md`. First line MUST be\n `PASS` or `FAIL`. If FAIL, include specific failing mocks and missing context.\n\n**Output:** `$KAIROS_WORK_DIR/stranger-review.md`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"test -f \\\"$KAIROS_WORK_DIR/stranger-review.md\\\" && head -1 \\\"$KAIROS_WORK_DIR/stranger-review.md\\\" | 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:** `$KAIROS_WORK_DIR/draft-protocol.md`\n\n**Actions:**\n1. Compute md5 checksum of the draft file.\n2. Write checksum to `$KAIROS_WORK_DIR/draft-protocol.md.md5`.\n\n**Output:** `$KAIROS_WORK_DIR/draft-protocol.md.md5`\n\n```json\n{\"contract\":{\"type\":\"shell\",\"shell\":{\"cmd\":\"md5 -q \\\"$KAIROS_WORK_DIR/draft-protocol.md\\\" > \\\"$KAIROS_WORK_DIR/draft-protocol.md.md5\\\" && test -s \\\"$KAIROS_WORK_DIR/draft-protocol.md.md5\\\"\",\"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 `$KAIROS_WORK_DIR/draft-protocol.md`\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.2.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## 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_WORK_DIR` for all temporary artifacts.\n\n**Rules:**\n- all file paths in shell challenges use `$KAIROS_WORK_DIR/`\n- when using KAIROS MCP, read `kairos_work_dir` from the latest `activate` / `forward` / `next` response and `export KAIROS_WORK_DIR=\"<path>\"` if your shell does not already define it (the server creates that directory at startup)\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**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. use stronger verification patterns instead of weak narrative checks\n",
|
|
32
|
+
"phase-critic": "---\nversion: \"4.2.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/00000000-0000-0000-0000-000000002005`.\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, branch, or configuration outside `$KAIROS_WORK_DIR`.\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 reference_document: string,\n calling_protocol_slug: string,\n verification_target: string,\n context: {\n operation: string,\n work_dir: string,\n verdict_file: string\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: \"$KAIROS_WORK_DIR/{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:** reference document, calling protocol slug, context\n\n**Actions:**\n1. Verify the reference document exists and is readable.\n2. Verify `$KAIROS_WORK_DIR` exists (if unset, export it from the latest `activate` / `forward` / `next` response field `kairos_work_dir`, then re-check).\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\":\"comment\",\"comment\":{\"min_length\":60},\"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`$CRITIC_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 `$KAIROS_WORK_DIR/$CRITIC_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 -n \\\"$CRITIC_VERDICT_FILE\\\" && test -f \\\"$KAIROS_WORK_DIR/$CRITIC_VERDICT_FILE\\\" && head -1 \\\"$KAIROS_WORK_DIR/$CRITIC_VERDICT_FILE\\\" | grep -qiE '^(PASS|FAIL)$' && sed -n '2p' \\\"$KAIROS_WORK_DIR/$CRITIC_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.2.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## System adapters vs user adapters\n\nSystem adapters chain using static UUIDs in `next_action`:\n\n```text\ncall forward with kairos://adapter/00000000-0000-0000-0000-000000002005 ...\n```\n\nUser-authored adapters use the slug instead:\n\n```text\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. distinguish system-UUID linking from user-slug linking\n4. apply MCP argument validation for deterministic chain links\n5. implement `chain_root` collapsing with defense-in-depth safeguards\n"
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedded-mcp-resources.js","sourceRoot":"","sources":["../../src/resources/embedded-mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,mBAAmB,EAAE,67HAA67H;KACn9H;IACD,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,OAAO,EAAE;QACP,UAAU,EAAE,wkEAAwkE;QACplE,QAAQ,EAAE,6dAA6d;QACve,QAAQ,EAAE,o1CAAo1C;QAC91C,SAAS,EAAE,43JAA43J;QACv4J,QAAQ,EAAE,8yBAA8yB;QACxzB,QAAQ,EAAE,44DAA44D;QACt5D,OAAO,EAAE,8pDAA8pD;QACvqD,MAAM,EAAE,k+BAAk+B;KAC3+B;IACD,KAAK,EAAE,EAAE;IACT,MAAM,EAAE;QACN,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"embedded-mcp-resources.js","sourceRoot":"","sources":["../../src/resources/embedded-mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,mBAAmB,EAAE,67HAA67H;KACn9H;IACD,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,OAAO,EAAE;QACP,UAAU,EAAE,wkEAAwkE;QACplE,QAAQ,EAAE,6dAA6d;QACve,QAAQ,EAAE,o1CAAo1C;QAC91C,SAAS,EAAE,43JAA43J;QACv4J,QAAQ,EAAE,8yBAA8yB;QACxzB,QAAQ,EAAE,44DAA44D;QACt5D,OAAO,EAAE,8pDAA8pD;QACvqD,MAAM,EAAE,k+BAAk+B;KAC3+B;IACD,KAAK,EAAE,EAAE;IACT,MAAM,EAAE;QACN,qBAAqB,EAAE,i/YAAi/Y;QACxgZ,eAAe,EAAE,whFAAwhF;QACziF,4BAA4B,EAAE,4xNAA4xN;QAC1zN,sBAAsB,EAAE,wnMAAwnM;QAChpM,cAAc,EAAE,4vNAA4vN;QAC5wN,wBAAwB,EAAE,k7LAAk7L;KAC78L;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,YAAY,CAAC,OAAO,IAAI,EAAE,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,YAAY,CAAC,KAAK,IAAI,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,YAAY,CAAC,GAAG,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO;IACrB,OAAO,YAAY,CAAC,IAAI,IAAI,EAAE,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,CAA2B,CAAC;IACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,EAAE,CAA2B,CAAC;QACjE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,SAAS,GAAG,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAAwB,CAAC;IACxE,IAAI,OAAO,GAAQ,SAAS,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC3C,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,EAAE,CAA2B,CAAC;IACjE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,SAAS,GAAG,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAA2B,CAAC;IAC3E,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAA2B,CAAC;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,IAAI,EAAE,CAA4B,CAAC,CAAC;IACrF,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAA4B,CAAC,CAAC;IAC5F,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,SAAS,IAAI,EAAE,CAA4B,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE,CAA4B,CAAC,CAAC;IAEjF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAC,CAAC;IAC/E,MAAM,MAAM,GAA6B,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAExF,qCAAqC;IACrC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBAChD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,GAAQ,EAAE,SAAiB,EAAE,EAAE,OAAiB,EAAE;IACxE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACvD,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,y as t}from"./vendor-uawy19jW.js";import{t as n}from"./react-nnqwRscp.js";import{n as r,r as i,t as a}from"./index-
|
|
1
|
+
import{g as e,y as t}from"./vendor-uawy19jW.js";import{t as n}from"./react-nnqwRscp.js";import{n as r,r as i,t as a}from"./index-Da2yvncA.js";import{t as o}from"./api-D88c6lbH.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-CRo8mNcK.js","assets/vendor-uawy19jW.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/tiptap-CYcAvjOe.js","assets/react-nnqwRscp.js","assets/SpaceSelect-DIDjtkBC.js","assets/api-D88c6lbH.js","assets/SurfaceCard-C0uBJPza.js","assets/KairosPage-Bib9zJu8.js","assets/ErrorAlert-DMKZP8Bu.js","assets/RunsPage-CtEX8sGc.js","assets/useRunSession-DnUNMlAi.js","assets/ProtocolEditPage-BgcnqEBN.js","assets/ChallengeCard-BZ5hfSjX.js","assets/RichTextEditor-DP6NpPMV.js","assets/useProtocol-LcBAbyj-.js","assets/RunGuidedPage-NH4deGgN.js","assets/StepFlowGraph-DZzQ0AQV.js","assets/SkillBundlePage-Dqet-EFY.js","assets/ProtocolDetailPage-CSbv65eY.js","assets/AccountPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-CRo8mNcK.js","assets/vendor-uawy19jW.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/tiptap-CYcAvjOe.js","assets/react-nnqwRscp.js","assets/SpaceSelect-DIDjtkBC.js","assets/api-D88c6lbH.js","assets/SurfaceCard-C0uBJPza.js","assets/KairosPage-Bib9zJu8.js","assets/ErrorAlert-DMKZP8Bu.js","assets/RunsPage-CtEX8sGc.js","assets/useRunSession-DnUNMlAi.js","assets/ProtocolEditPage-BgcnqEBN.js","assets/ChallengeCard-BZ5hfSjX.js","assets/RichTextEditor-DP6NpPMV.js","assets/useProtocol-LcBAbyj-.js","assets/RunGuidedPage-NH4deGgN.js","assets/StepFlowGraph-DZzQ0AQV.js","assets/SkillBundlePage-Dqet-EFY.js","assets/ProtocolDetailPage-CSbv65eY.js","assets/AccountPage-BoA6v1P5.js","assets/NotFoundPage-BAhX5b1F.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as e}from"./rolldown-runtime-S-ySWqyJ.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-uawy19jW.js";import{i as p,n as m,t as h}from"./react-nnqwRscp.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/{uuid}`,"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/{uuid} 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.2.2
|
|
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/{uuid}`,"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/{uuid} 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.2.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-CRo8mNcK.js`).then(e=>({default:e.HomePage})),__vite__mapDeps([0,1,2,3,4,5,6,7]))),C=(0,g.lazy)(()=>o(()=>import(`./KairosPage-Bib9zJu8.js`).then(e=>({default:e.KairosPage})),__vite__mapDeps([8,2,1,3,4,9,5,6]))),w=(0,g.lazy)(()=>o(()=>import(`./RunsPage-CtEX8sGc.js`).then(e=>({default:e.RunsPage})),__vite__mapDeps([10,1,2,3,4,11]))),T=(0,g.lazy)(()=>o(()=>import(`./ProtocolEditPage-BgcnqEBN.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-NH4deGgN.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-Dqet-EFY.js`).then(e=>({default:e.SkillBundlePage})),__vite__mapDeps([18,2,1,3,4,14,7,15,6]))),O=(0,g.lazy)(()=>o(()=>import(`./ProtocolDetailPage-CSbv65eY.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-BoA6v1P5.js`).then(e=>({default:e.AccountPage})),__vite__mapDeps([20,1,2,3,4,6]))),A=(0,g.lazy)(()=>o(()=>import(`./NotFoundPage-BAhX5b1F.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-Da2yvncA.js"></script>
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/ui/assets/rolldown-runtime-S-ySWqyJ.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/ui/assets/react-nnqwRscp.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/ui/assets/tiptap-CYcAvjOe.js">
|
package/package.json
CHANGED