@a-company/paradigm 5.27.1 → 5.31.0
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/agent-loader-CZFB5BDP.js +2 -0
- package/dist/agent-loader-EBERCNMO.js +2 -0
- package/dist/{ambient-2RAKMUC7.js → ambient-S3CXHD7P.js} +9 -9
- package/dist/{chunk-DJERXYEL.js → chunk-5KSNYRT7.js} +5 -5
- package/dist/{chunk-HBGRP73K.js → chunk-AYYS2AMB.js} +1 -1
- package/dist/chunk-QWL3LERH.js +3 -0
- package/dist/{chunk-UELDOSWH.js → chunk-SL3RZQPW.js} +1 -1
- package/dist/chunk-TZZNHUAR.js +2 -0
- package/dist/chunk-U4J5J7GG.js +3 -0
- package/dist/{chunk-PBVBTHGE.js → chunk-VKGY42FP.js} +1 -1
- package/dist/{chunk-4YIKDQRB.js → chunk-VNQGILQU.js} +2 -2
- package/dist/{compliance-LM2NN2S6.js → compliance-5OYNHE5D.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp.js +80 -42
- package/dist/{nomination-engine-K7MQD53E.js → nomination-engine-LMSZ2CAS.js} +1 -1
- package/dist/{project-type-4Y6CESWP.js → project-type-AGO6VUKF.js} +1 -1
- package/dist/reindex-BSD7ZIEY.js +2 -0
- package/dist/{roster-K2QILE7K.js → roster-TA2GFDR7.js} +1 -1
- package/dist/session-tracker-FDFL4PZI.js +2 -0
- package/dist/{session-work-log-IEYBPFUC.js → session-work-log-5PHOUEQ6.js} +1 -1
- package/dist/{session-work-log-HFOD7LEG.js → session-work-log-LWEGZ5CN.js} +1 -1
- package/dist/{shift-WNP27SPB.js → shift-BRZLKOH6.js} +1 -1
- package/dist/university-content/courses/.purpose +52 -8
- package/dist/university-content/courses/para-001.json +166 -0
- package/dist/university-content/courses/para-101.json +88 -88
- package/dist/university-content/courses/para-201.json +27 -55
- package/dist/university-content/courses/para-301.json +114 -8
- package/dist/university-content/courses/para-401.json +90 -62
- package/dist/university-content/courses/para-501.json +55 -0
- package/package.json +1 -1
- package/dist/agent-loader-MQMXCI3D.js +0 -2
- package/dist/agent-loader-RGPE3LRD.js +0 -2
- package/dist/chunk-4DVT5IEY.js +0 -2
- package/dist/chunk-XGAOYG77.js +0 -3
- package/dist/chunk-ZMQXXFG2.js +0 -3
- package/dist/reindex-HA3CJG7S.js +0 -2
- package/dist/session-tracker-G7VOLRMR.js +0 -2
|
@@ -179,92 +179,67 @@
|
|
|
179
179
|
{
|
|
180
180
|
"id": "agent-roles",
|
|
181
181
|
"title": "Agent Roles & Facets",
|
|
182
|
-
"content": "## Agent
|
|
182
|
+
"content": "## The Agent Roster: 8 Core, 54+ Total\n\nParadigm ships with over 54 agent definitions. You do not use all of them — `paradigm shift` auto-selects a project roster based on your detected project type. But understanding the hierarchy helps you work with the orchestrator effectively.\n\n### Three-Tier Hierarchy\n\n**Core agents (8)** are available in every project. These are the backbone of orchestration:\n\n| Nickname | Role | Model Tier | Purpose |\n|----------|------|-----------|---------|\n| — | **Architect** | Tier-1 (opus) | System design, multi-file planning |\n| — | **Builder** | Tier-3 (haiku) | Implementation, code generation |\n| — | **Reviewer** | Tier-2 (sonnet) | Two-stage code review (spec → quality) |\n| Sage | **Advocate** | Tier-2 (sonnet) | User perspective, UX implications |\n| Jinx | **Advocate** | Tier-2 (sonnet) | Stress-tests assumptions, finds edge cases |\n| Sentinel | **Security** | Tier-1 (opus) | Threat analysis, auth review, OWASP |\n| Doc | **Documentor** | Tier-2 (sonnet) | .purpose files, portal.yaml — Paradigm metadata only |\n| Rune | **Compliance** | Tier-2 (sonnet) | Symbol planning, 1:1 aspect enforcement |\n| Vigil | **Tester** | Tier-3 (haiku) | Test writing, coverage, edge cases |\n\n**Specialized agents (~20)** cover domains like mobile, database, DevOps, accessibility, and performance. They are rostered when your project type matches their expertise.\n\n**Ecosystem agents (~26+)** are language/platform-specific — Swift, TypeScript, Rust, Python ML, iOS, Android, etc. They accumulate per-ecosystem knowledge through notebooks that transfer across projects.\n\n> **Deep dive:** PARA 701 covers the full roster, agent profiles, notebooks, per-project customization, and the learning feedback loop.\n\n### Rune: The Compliance Specialist\n\nRune is the 8th core agent, added specifically to prevent a common failure mode: building features without proper symbol coverage.\n\n**Before implementation**, Rune creates a **Symbol Plan**:\n- Enumerates all `#components`, `$flows`, `!signals`, `~aspects` the task needs\n- Creates symbol stubs via MCP tools (`paradigm_purpose_add_component`, etc.)\n- Enforces a **1:1 component-to-aspect ratio** — every component must have at least one aspect\n\n**After implementation**, Rune produces a **Compliance Report**:\n- Validates that planned symbols were actually created\n- Checks that aspect anchors point to valid code\n- Verifies flows exist for logic spanning 3+ components\n- Reports findings as blocking (must fix) or passing\n\nRune never modifies source code — only Paradigm metadata files (.purpose, portal.yaml). Think of Rune as the \"symbol bookkeeper\" who ensures the spec matches the code.\n\n### Facet Configuration\n\nEach agent role is a **facet** with four dimensions defined in `.paradigm/agents.yaml`:\n\n- **`defaultModel`** — Which AI model to use (opus for complex reasoning, sonnet for balanced, haiku for fast execution)\n- **`context.include / context.exclude`** — Which files the agent sees (scoped to reduce token waste)\n- **`limits.maxTokens`** — Budget per invocation (architects get more, builders get less)\n- **`protocol.relay`** — How results are reported: `structured` (JSON), `markdown` (narrative), or `handoff` (file for next agent)\n\n```yaml\n# Example from agents.yaml\narchitect:\n defaultModel: opus\n context:\n include: [\"**/.purpose\", \"portal.yaml\", \".paradigm/specs/**\"]\n exclude: [\"**/*.test.*\", \"node_modules/**\"]\n limits:\n maxTokens: 30000\n protocol:\n relay: structured\n```\n\n### Handoff Context\n\nAgents run in sequence, each receiving the previous agent's output via `handoffContext`:\n\n```\nRune (symbol plan) → Architect (design) → Security (review) → Builder (implement) → Reviewer (check) → Rune (compliance report) → Doc (.purpose files)\n```\n\nThe `paradigm_agent_prompt` tool accepts `previousAgent` and `handoffContext` parameters to thread this chain.\n\n### Reviewer Protocol\n\nThe reviewer follows a strict **two-stage protocol**:\n\n**Stage 1 (Spec Compliance)** — checks .purpose registrations, portal.yaml gates, flow steps, signal emissions, aspect enforcement. If Stage 1 fails, the reviewer **stops immediately** and hands back to the builder.\n\n**Stage 2 (Code Quality)** — only runs if Stage 1 passes. Covers OWASP security, conventions, test coverage, performance, error handling.\n\nEvery review must produce a **minimum of 3 categorized findings**: blocking (must fix), improvement (should fix), or note (informational). A rubber-stamp \"looks good\" with zero findings is never acceptable.",
|
|
183
183
|
"keyConcepts": [
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
184
|
+
"Three-tier hierarchy: 8 core agents, ~20 specialized, ~26+ ecosystem",
|
|
185
|
+
"Rune (compliance) handles pre-build symbol planning and post-build compliance reports",
|
|
186
|
+
"1:1 component-to-aspect ratio is enforced by Rune — every component needs at least one aspect",
|
|
187
|
+
"Facets define model, context scope, token budget, and relay protocol per agent",
|
|
188
|
+
"Reviewer uses two-stage protocol: spec compliance first, code quality only if spec passes",
|
|
189
|
+
"paradigm shift auto-selects a roster based on project type"
|
|
189
190
|
],
|
|
190
191
|
"quiz": [
|
|
191
192
|
{
|
|
192
193
|
"id": "q1",
|
|
193
|
-
"question": "
|
|
194
|
+
"question": "You are about to add a payment refund feature that touches 5 files including auth middleware. The orchestrator composes a team. Which agents would you expect to see, and why?",
|
|
194
195
|
"choices": {
|
|
195
|
-
"A": "
|
|
196
|
-
"B": "
|
|
197
|
-
"C": "
|
|
198
|
-
"D": "
|
|
199
|
-
"E": "
|
|
196
|
+
"A": "Only builder — it is an implementation task",
|
|
197
|
+
"B": "Architect (5 files = multi-file design), Sentinel (auth middleware = security), builder (implementation), Vigil (testing), Rune (symbol planning)",
|
|
198
|
+
"C": "Only architect and builder — the others are optional",
|
|
199
|
+
"D": "All 54+ agents are always activated for every task",
|
|
200
|
+
"E": "Only Sentinel — payment features are a security concern"
|
|
200
201
|
},
|
|
201
202
|
"correct": "B",
|
|
202
|
-
"explanation": "
|
|
203
|
+
"explanation": "The orchestrator uses trigger patterns: 5 files triggers the architect for upfront design, auth middleware triggers Sentinel for security review, implementation triggers builder, the complexity triggers Vigil for testing, and Rune always runs for symbol planning on orchestrated tasks. This is how the \"right team for the task\" is composed automatically."
|
|
203
204
|
},
|
|
204
205
|
{
|
|
205
206
|
"id": "q2",
|
|
206
|
-
"question": "
|
|
207
|
+
"question": "After building a new feature, Rune's compliance report shows: \"3 components created, 1 aspect defined. Blocking: 2 components missing aspects (1:1 ratio violated).\" What do you do?",
|
|
207
208
|
"choices": {
|
|
208
|
-
"A": "
|
|
209
|
-
"B": "
|
|
210
|
-
"C": "
|
|
211
|
-
"D": "
|
|
212
|
-
"E": "
|
|
209
|
+
"A": "Ignore the report — aspects are optional metadata",
|
|
210
|
+
"B": "Delete the 2 components to make the ratio work",
|
|
211
|
+
"C": "Add aspects to the 2 uncovered components — define what rules, constraints, or configuration each component enforces",
|
|
212
|
+
"D": "Reduce the aspect count to 0 so the ratio is consistently zero",
|
|
213
|
+
"E": "Ask the architect to redesign the feature with fewer components"
|
|
213
214
|
},
|
|
214
|
-
"correct": "
|
|
215
|
-
"explanation": "
|
|
215
|
+
"correct": "C",
|
|
216
|
+
"explanation": "Rune enforces a 1:1 component-to-aspect ratio because every component should have at least one documented rule, constraint, or configuration. Adding aspects is the correct fix — it forces you to think about what rules govern each component. If a component truly has no rules, it may be too small to be its own component."
|
|
216
217
|
},
|
|
217
218
|
{
|
|
218
219
|
"id": "q3",
|
|
219
|
-
"question": "The
|
|
220
|
+
"question": "The reviewer runs Stage 1 (Spec Compliance) and finds that #checkout-form is not registered in any .purpose file. What happens?",
|
|
220
221
|
"choices": {
|
|
221
|
-
"A": "
|
|
222
|
-
"B": "The
|
|
223
|
-
"C": "
|
|
224
|
-
"D": "The
|
|
225
|
-
"E": "
|
|
222
|
+
"A": "The reviewer proceeds to Stage 2 and includes the missing registration as a note",
|
|
223
|
+
"B": "The reviewer stops immediately, reports a blocking finding, and hands back to the builder without Stage 2",
|
|
224
|
+
"C": "The reviewer auto-creates the .purpose entry and continues",
|
|
225
|
+
"D": "The reviewer skips both stages and approves with a warning",
|
|
226
|
+
"E": "The reviewer asks Rune to fix it"
|
|
226
227
|
},
|
|
227
228
|
"correct": "B",
|
|
228
|
-
"explanation": "
|
|
229
|
+
"explanation": "The two-stage protocol is a hard gate: Stage 1 failure means immediate stop. There is no point reviewing code quality of spec-noncompliant code. The builder must fix the spec issue first, then resubmit. This ensures Paradigm metadata is always in sync with code before quality review begins."
|
|
229
230
|
},
|
|
230
231
|
{
|
|
231
232
|
"id": "q4",
|
|
232
|
-
"question": "
|
|
233
|
+
"question": "Your project is a React web app. After running paradigm shift, the roster includes architect, builder, reviewer, Sage, Jinx, Sentinel, Doc, Rune, Vigil, plus accessibility and performance specialists. A teammate's Python ML project has a different roster. Why?",
|
|
233
234
|
"choices": {
|
|
234
|
-
"A": "
|
|
235
|
-
"B": "
|
|
236
|
-
"C": "
|
|
237
|
-
"D": "
|
|
238
|
-
"E": "
|
|
235
|
+
"A": "paradigm shift uses random selection",
|
|
236
|
+
"B": "Each project type gets a tailored roster — web apps get accessibility/performance specialists, ML projects get data pipeline/model evaluation specialists",
|
|
237
|
+
"C": "The Python project is missing agents and needs manual configuration",
|
|
238
|
+
"D": "All projects get the same roster but with different model assignments",
|
|
239
|
+
"E": "The difference is because of different Paradigm versions"
|
|
239
240
|
},
|
|
240
241
|
"correct": "B",
|
|
241
|
-
"explanation": "
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"id": "q5",
|
|
245
|
-
"question": "A task description mentions 'add rate limiting to the API with security audit'. Which trigger patterns activate?",
|
|
246
|
-
"choices": {
|
|
247
|
-
"A": "Only builder -- it is an implementation task",
|
|
248
|
-
"B": "Only security -- it mentions 'security audit'",
|
|
249
|
-
"C": "Security (triggered by 'security') and builder (triggered by implementation need), plus architect if 3+ files are affected",
|
|
250
|
-
"D": "All five agents are always triggered regardless of the task",
|
|
251
|
-
"E": "Only tester -- rate limiting needs testing"
|
|
252
|
-
},
|
|
253
|
-
"correct": "C",
|
|
254
|
-
"explanation": "Trigger patterns analyze the task description: 'security audit' triggers the security agent, the implementation need triggers the builder, and if the task affects 3+ files, the architect is triggered for upfront design. The orchestrator combines these signals to compose the right team."
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"id": "q6",
|
|
258
|
-
"question": "The reviewer agent runs Stage 1 (Spec Compliance) and finds that #checkout-form is not registered in any .purpose file. What happens next?",
|
|
259
|
-
"choices": {
|
|
260
|
-
"A": "The reviewer proceeds to Stage 2 (Code Quality) and includes the missing registration as a note",
|
|
261
|
-
"B": "The reviewer stops immediately, reports a blocking finding, and hands back to the builder without running Stage 2",
|
|
262
|
-
"C": "The reviewer auto-creates the .purpose entry and continues",
|
|
263
|
-
"D": "The reviewer skips both stages and approves with a warning",
|
|
264
|
-
"E": "The reviewer runs both stages in parallel and combines results"
|
|
265
|
-
},
|
|
266
|
-
"correct": "B",
|
|
267
|
-
"explanation": "The two-stage protocol is a hard gate: if Stage 1 (Spec Compliance) fails, the reviewer stops immediately and reports blocking findings. There is no point reviewing code quality of spec-noncompliant code -- it is wasted effort. The builder must fix the spec compliance issues first, then resubmit for review."
|
|
242
|
+
"explanation": "paradigm shift auto-detects project type from markers (package.json = web/node, requirements.txt = Python, etc.) and selects specialized agents that match. The 8 core agents appear in every roster, but specialized and ecosystem agents vary. A web app gets accessibility and performance; an ML project gets data pipeline and model evaluation."
|
|
268
243
|
}
|
|
269
244
|
]
|
|
270
245
|
},
|
|
@@ -413,6 +388,59 @@
|
|
|
413
388
|
}
|
|
414
389
|
]
|
|
415
390
|
},
|
|
391
|
+
{
|
|
392
|
+
"id": "quick-check",
|
|
393
|
+
"title": "Quick-Check: Ask Before You Build",
|
|
394
|
+
"content": "## The Lightweight Pre-Check\n\nNot every task needs full orchestration with architect, security, builder, tester, and reviewer stages. Sometimes you just want to know: *is this task ready to build, or does it need more planning?*\n\nThat is what **quick-check mode** does. It runs a lightweight risk assessment (~3–4k tokens) and returns one of two verdicts:\n\n- **GREENLIGHT** — proceed to implementation. The task is well-scoped, low-risk, and does not need multi-agent planning.\n- **ESCALATE** — this needs full orchestration. The task has unaddressed risks, ambiguous requirements, or cross-cutting concerns.\n\n### How It Works\n\nQuick-check uses two agents:\n\n**Jinx (advocate)** stress-tests your assumptions:\n- \"What if the user loses their second factor?\"\n- \"What happens when the payment provider is down?\"\n- \"Did you consider rate limiting on this endpoint?\"\n\n**Reviewer** checks feasibility:\n- Does this touch auth, security, or shared state?\n- How many files will this change?\n- Are there dependencies that need updating?\n\nTheir combined assessment produces the verdict. If either agent raises concerns that cannot be resolved in a quick check, the verdict is ESCALATE.\n\n### Usage\n\n```\nparadigm_orchestrate_inline({\n task: \"Add a 'last seen' timestamp to user profiles\",\n mode: \"quick\"\n})\n```\n\nCompare with full orchestration:\n```\nparadigm_orchestrate_inline({\n task: \"Add two-factor authentication to the login flow\",\n mode: \"plan\"\n})\n```\n\n### When to Use Quick-Check vs Full Orchestration\n\n| Signal | Quick-Check | Full Orchestration |\n|--------|-------------|-------------------|\n| Single file change | Yes | Overkill |\n| UI-only change (styling, layout) | Yes | Overkill |\n| Touches auth or security | Depends on scope | Usually yes |\n| 3+ files affected | Depends on complexity | Yes |\n| New API endpoint | Depends on gates needed | Usually yes |\n| Infrastructure change | No | Yes |\n| Unknown scope (\"make it faster\") | No | Yes |\n\n**Rule of thumb:** If you can describe the complete change in one sentence and it touches ≤2 files, quick-check is appropriate. If you find yourself saying \"and also...\" or \"but we need to consider...\", go straight to full orchestration.\n\n### Quick-Check and Enforcement\n\nQuick-check satisfies the `orchestration-required` enforcement check. On balanced or strict enforcement, the stop hook requires that complex tasks go through orchestration before building. A GREENLIGHT from quick-check counts — you do not need to run full orchestration after a greenlight.\n\nHowever, if you get an ESCALATE verdict and proceed to build anyway, the stop hook will flag that you bypassed the recommendation. The verdict is recorded and traceable.\n\n### Example Walkthrough\n\n**Task:** \"Add a 'forgot password' link to the login page\"\n\n**Jinx:** \"Where does the reset email get sent from? Is there rate limiting on reset requests? What happens if the email is not in the system — do you reveal that?\"\n\n**Reviewer:** \"This touches auth (password reset flow), requires a new API endpoint (/reset-password), involves email sending infrastructure, and needs rate limiting. Estimated: 4+ files.\"\n\n**Verdict: ESCALATE** — the task looks simple but involves auth, a new endpoint, email, and rate limiting. Full orchestration with Sentinel (security) and architect (multi-file design) is recommended.\n\nCompare: \"Change the login button color from blue to green\" → **GREENLIGHT** (single CSS change, no logic, no auth).",
|
|
395
|
+
"keyConcepts": [
|
|
396
|
+
"Quick-check is a lightweight pre-implementation risk assessment (~3-4k tokens)",
|
|
397
|
+
"Two agents: Jinx stress-tests assumptions, reviewer checks feasibility",
|
|
398
|
+
"Two outcomes: GREENLIGHT (proceed) or ESCALATE (needs full orchestration)",
|
|
399
|
+
"Satisfies orchestration-required enforcement — a greenlight counts as orchestration",
|
|
400
|
+
"Rule of thumb: one-sentence change + ≤2 files = quick-check, otherwise full orchestration"
|
|
401
|
+
],
|
|
402
|
+
"quiz": [
|
|
403
|
+
{
|
|
404
|
+
"id": "q1",
|
|
405
|
+
"question": "You need to rename a CSS class from .btn-primary to .btn-main across 2 files. Your project uses balanced enforcement with orchestration-required set to warn. What do you do?",
|
|
406
|
+
"choices": {
|
|
407
|
+
"A": "Run full orchestration — any change should go through the full pipeline",
|
|
408
|
+
"B": "Run quick-check — it is a scoped, low-risk change that will likely get GREENLIGHT",
|
|
409
|
+
"C": "Skip orchestration entirely — CSS changes do not count as \"complex tasks\"",
|
|
410
|
+
"D": "Ask the architect to plan the rename first",
|
|
411
|
+
"E": "Disable orchestration-required for this one task"
|
|
412
|
+
},
|
|
413
|
+
"correct": "B",
|
|
414
|
+
"explanation": "A CSS class rename across 2 files is exactly the kind of scoped, low-risk change quick-check is designed for. It will likely GREENLIGHT. Skipping orchestration entirely would trigger the enforcement warning. Running full orchestration would waste tokens on a trivial change. Quick-check gives you the compliance checkmark at minimal cost."
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"id": "q2",
|
|
418
|
+
"question": "Quick-check returns ESCALATE for your task \"add user deletion endpoint.\" You are short on time and want to build it anyway. What are the consequences?",
|
|
419
|
+
"choices": {
|
|
420
|
+
"A": "Nothing — ESCALATE is just a suggestion",
|
|
421
|
+
"B": "The build will fail at compile time",
|
|
422
|
+
"C": "The stop hook will flag that you bypassed an ESCALATE recommendation, and the verdict is recorded for traceability",
|
|
423
|
+
"D": "Your code will be automatically reverted",
|
|
424
|
+
"E": "The orchestrator will refuse to run any further tasks"
|
|
425
|
+
},
|
|
426
|
+
"correct": "C",
|
|
427
|
+
"explanation": "ESCALATE is a recorded recommendation, not a hard block (unless orchestration-required is set to block in strict enforcement). However, the stop hook flags the bypass, and the verdict is traceable in the session history. A user deletion endpoint likely needs security review (Sentinel) and architectural planning — skipping that introduces real risk."
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"id": "q3",
|
|
431
|
+
"question": "During quick-check, Jinx asks: \"What if the email service is down when sending password reset?\" and the reviewer notes \"touches auth, new endpoint, email infra — estimated 4+ files.\" The verdict is ESCALATE. Which agents would full orchestration likely include?",
|
|
432
|
+
"choices": {
|
|
433
|
+
"A": "Only builder — the task is clearly defined",
|
|
434
|
+
"B": "Architect (4+ files), Sentinel (auth + password reset), builder, Vigil (tester), Rune (symbols)",
|
|
435
|
+
"C": "Only Sentinel — it is a security task",
|
|
436
|
+
"D": "All 54 agents to be thorough",
|
|
437
|
+
"E": "Jinx and reviewer again, but with more tokens"
|
|
438
|
+
},
|
|
439
|
+
"correct": "B",
|
|
440
|
+
"explanation": "Full orchestration composes the team from trigger patterns: 4+ files triggers architect for multi-file design, auth/password triggers Sentinel for security review, implementation triggers builder, complexity triggers Vigil for testing, and Rune always runs for symbol planning. This is the value of ESCALATE — it routes you to the right team composition."
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
416
444
|
{
|
|
417
445
|
"id": "pm-governance",
|
|
418
446
|
"title": "PM Governance",
|
|
@@ -837,4 +865,4 @@
|
|
|
837
865
|
]
|
|
838
866
|
}
|
|
839
867
|
]
|
|
840
|
-
}
|
|
868
|
+
}
|
|
@@ -956,6 +956,61 @@
|
|
|
956
956
|
}
|
|
957
957
|
]
|
|
958
958
|
},
|
|
959
|
+
{
|
|
960
|
+
"id": "conductor-workspace",
|
|
961
|
+
"title": "Conductor: Visual Mission Control",
|
|
962
|
+
"content": "## What Is Conductor?\n\nConductor is a native macOS application that serves as the visual mission control for Paradigm. While the CLI and MCP tools handle the automation, Conductor gives you a real-time view of what your agent team is doing — and lets you interact with them visually.\n\nThink of it as the difference between managing a team over email versus walking into a mission control room. Both work, but the room gives you instant awareness.\n\n### Core Capabilities\n\n**Workspace Mode** — A full-screen tiling window manager for Claude Code sessions. Launch multiple terminals side by side, split horizontally or vertically, drag dividers to resize. Six layout presets (single, split-h, split-v, quad, triple, grid) let you quickly arrange your workspace.\n\n**Symphony Integration** — Conductor connects to Symphony, the inter-agent messaging system. When agents communicate during orchestration (handing off context, requesting approval, debating approaches), those messages appear in Conductor's thread view in real time. You can read the full conversation without switching to the CLI.\n\n**Task Protocol** — A structured protocol for human-agent coordination with 7 intents:\n- `task` — assign work to an agent\n- `task-ack` — agent acknowledges receipt\n- `progress` — agent reports progress\n- `approval-request` — agent asks for human approval\n- `approval-response` — human approves or rejects\n- `task-complete` — agent reports success\n- `task-failed` — agent reports failure\n\nThis protocol makes agent work visible and controllable. You see when agents are working, what they are asking, and whether they succeeded.\n\n**Agent Health Dashboard** — Per-agent metrics: success rates, average time-per-task, acceptance rates for contributions. Sparklines show trends over time. When an agent's performance drops, you see it immediately.\n\n**Live Sentinel** — Real-time event viewer with symbol filtering. When Sentinel detects an incident or pattern, it appears in Conductor's event feed with full detail and suggested resolution.\n\n### Architecture\n\nConductor is built with Swift and SwiftUI — a native macOS application, not an Electron wrapper. Key design decisions:\n\n- **Single-owner pattern** — AppDelegate owns the orchestrator, workspace, project store, and agent process manager. No shared mutable state.\n- **Local-only ML** — Gaze tracking, gesture recognition, and voice commands all run locally via CoreML. Zero cloud, zero cost, zero latency.\n- **SwiftTerm embedding** — Terminal sessions use SwiftTerm, a native Swift terminal emulator. Each session is a real PTY with full ANSI support.\n- **7 platform protocols** — Abstraction layer for future portability (the same protocol set would power a Windows or Linux version).\n\n### Getting Started\n\nBuild and install Conductor:\n\n```bash\ncd packages/conductor\n./build-conductor.sh --install\n```\n\nThis produces `Conductor.app` in `/Applications`. Launch it, and it connects to your Paradigm project automatically.\n\n### When to Use Conductor\n\n- **During orchestration** — watch agents work in real time, approve contributions, read debates\n- **Multi-session development** — tile 2-4 Claude Code sessions side by side, each working on different parts of the codebase\n- **Monitoring** — keep Conductor visible on a secondary display to catch Sentinel events and agent health changes\n- **Team collaboration** — when multiple developers use Symphony, Conductor shows cross-session threads and file approval requests\n\nConductor is optional — everything it shows is also available via CLI and MCP tools. But for teams that want visual awareness of their agent team, it is the command center.",
|
|
963
|
+
"keyConcepts": [
|
|
964
|
+
"Conductor is a native macOS SwiftUI application — not Electron",
|
|
965
|
+
"Workspace mode provides tiling terminal management with 6 layout presets",
|
|
966
|
+
"Symphony integration shows inter-agent messages in real time",
|
|
967
|
+
"Task protocol has 7 intents for structured human-agent coordination",
|
|
968
|
+
"Agent health dashboard tracks per-agent success rates and trends",
|
|
969
|
+
"All ML inference (gaze, gesture, voice) runs locally via CoreML",
|
|
970
|
+
"Optional but powerful — everything is also available via CLI"
|
|
971
|
+
],
|
|
972
|
+
"quiz": [
|
|
973
|
+
{
|
|
974
|
+
"id": "q1",
|
|
975
|
+
"question": "During orchestration, the security agent sends an approval-request via Symphony asking to modify portal.yaml. Where would you see and respond to this in Conductor?",
|
|
976
|
+
"choices": {
|
|
977
|
+
"A": "In the terminal session where the agent is running",
|
|
978
|
+
"B": "In the Symphony thread view — approval-request is a task protocol intent that appears as a message you can approve or reject",
|
|
979
|
+
"C": "In the agent health dashboard under the security agent's metrics",
|
|
980
|
+
"D": "In the Sentinel event feed as a security incident",
|
|
981
|
+
"E": "You cannot — approval requests only work via CLI"
|
|
982
|
+
},
|
|
983
|
+
"correct": "B",
|
|
984
|
+
"explanation": "Symphony messages, including task protocol intents like approval-request, appear in Conductor's thread view in real time. The task protocol is designed for human-agent coordination — you see the request, read the context, and respond with approval-response directly in the thread view. This is one of Conductor's key advantages over CLI-only workflows."
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"id": "q2",
|
|
988
|
+
"question": "You want to work on the frontend and backend of a feature simultaneously with two Claude Code sessions. How would you set this up in Conductor?",
|
|
989
|
+
"choices": {
|
|
990
|
+
"A": "Launch two separate Conductor apps",
|
|
991
|
+
"B": "Use workspace mode with a split-h or split-v layout preset, launching one terminal session per pane",
|
|
992
|
+
"C": "Conductor only supports one session at a time",
|
|
993
|
+
"D": "Use the agent health dashboard to assign work to two agents",
|
|
994
|
+
"E": "Use Symphony to relay messages between two CLI sessions instead"
|
|
995
|
+
},
|
|
996
|
+
"correct": "B",
|
|
997
|
+
"explanation": "Conductor's workspace mode is a tiling window manager for Claude Code sessions. Choose a split layout preset (horizontal or vertical), and each pane gets its own terminal session. Both sessions connect to Symphony, so they can coordinate via inter-agent messaging while you watch both in a single window."
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"id": "q3",
|
|
1001
|
+
"question": "Conductor's ML features (gaze tracking, gesture recognition, voice commands) all run locally via CoreML. Why is this significant?",
|
|
1002
|
+
"choices": {
|
|
1003
|
+
"A": "CoreML is faster than cloud APIs for all tasks",
|
|
1004
|
+
"B": "It means zero cloud cost, zero data leaving your machine, and zero network latency — critical for a developer tool that sees your code and screen",
|
|
1005
|
+
"C": "Apple requires all macOS apps to use CoreML",
|
|
1006
|
+
"D": "Cloud ML services do not support gaze tracking",
|
|
1007
|
+
"E": "It is not significant — it is just an implementation detail"
|
|
1008
|
+
},
|
|
1009
|
+
"correct": "B",
|
|
1010
|
+
"explanation": "For a developer tool that has access to your codebase, screen content, and camera feed, privacy is paramount. Local-only ML means your data never leaves your machine — no cloud processing, no storage, no costs. The zero-latency benefit is a bonus, but the privacy guarantee is the real reason this design choice matters."
|
|
1011
|
+
}
|
|
1012
|
+
]
|
|
1013
|
+
},
|
|
959
1014
|
{
|
|
960
1015
|
"id": "symphony-networking",
|
|
961
1016
|
"title": "Symphony Networking: Cross-Machine Relay",
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {t}from'./chunk-ZMQXXFG2.js';export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-ZMQXXFG2.js';import'./chunk-5TAVYPOV.js';t();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export{n as buildProfileEnrichment,p as checkPathPermission,q as checkToolPermission,r as computeIntegrityHash,i as createAgentProfile,a as decayedConfidence,c as isAgentActive,e as listAllGlobalAgentIds,f as loadAgentProfile,g as loadAllAgentProfiles,b as loadProjectRoster,m as mergeAgentProfileWithManifest,j as queryExpertise,h as saveAgentProfile,d as saveProjectRoster,o as syncExpertiseFromLore,l as updateExpertiseFromAssessment,k as updateExpertiseFromLore,s as verifyIntegrity}from'./chunk-XGAOYG77.js';import'./chunk-5TAVYPOV.js';
|
package/dist/chunk-4DVT5IEY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as a from'fs';import*as c from'path';import {Glob}from'glob';function s(t){let e=r=>{if(r.includes("*"))try{return new Glob(r,{cwd:t,nodir:!0}).walkSync().length>0}catch{return false}return a.existsSync(c.join(t,r))};return e("project.godot")||e("Assets/ProjectSettings")?"game":e("Package.swift")&&!e("package.json")?e("Sources/*/App")||e("**/AppDelegate.swift")?"macos-app":"ios-app":e("pubspec.yaml")?"flutter-app":e("supabase")&&(e("next.config.*")||e("vite.config.*"))?"saas-web-app":e("next.config.*")||e("vite.config.*")||e("nuxt.config.*")?"web-app":e("Dockerfile")||e("prisma")||e("drizzle.config.*")?"backend-api":e("Cargo.toml")?"rust-project":e("pyproject.toml")||e("setup.py")||e("requirements.txt")?"python-project":"generic"}var n={"saas-web-app":["advocate","architect","builder","reviewer","tester","security","documentor","designer","copywriter","performance","devops","dba","e2e","dx","seo","pm","product","sales","legal","a11y","qa","debugger","release","narrator"],"web-app":["advocate","architect","builder","reviewer","tester","security","documentor","designer","copywriter","performance","devops","e2e","seo","a11y","qa","debugger"],"backend-api":["advocate","architect","builder","reviewer","tester","security","documentor","devops","dba","performance","dx","qa","debugger","release"],"ios-app":["advocate","architect","builder","reviewer","tester","security","documentor","designer","mobile","performance","a11y","qa","debugger"],"macos-app":["advocate","architect","builder","reviewer","tester","security","documentor","designer","performance","qa","debugger"],"flutter-app":["advocate","architect","builder","reviewer","tester","security","documentor","designer","mobile","performance","a11y","debugger"],game:["advocate","architect","builder","reviewer","tester","documentor","gamedev","3d","audio","designer","performance","debugger"],"rust-project":["advocate","architect","builder","reviewer","tester","security","documentor","performance","debugger","qa"],"python-project":["advocate","architect","builder","reviewer","tester","security","documentor","performance","debugger","qa"],generic:["advocate","architect","builder","reviewer","tester","security","documentor","debugger","qa"]};export{s as a,n as b};
|
package/dist/chunk-XGAOYG77.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import*as l from'fs';import*as u from'path';import*as S from'os';import*as k from'crypto';import*as d from'js-yaml';var P={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"},documentor:{style:"methodical",risk:"conservative",verbosity:"concise"}},v={architect:{symbols:["$*","#*"],concepts:["architecture","design","pattern","refactor"],signals:[{type:"flow-modified"},{type:"compliance-violation"}],threshold:.5},builder:{paths:["src/**","lib/**","packages/**"],signals:[{type:"file-modified"},{type:"error-encountered"}],threshold:.7},reviewer:{concepts:["code quality","bug","smell","convention"],signals:[{type:"compliance-violation"}],threshold:.6},tester:{paths:["**/*.test.*","**/*.spec.*"],concepts:["test","coverage","assertion"],signals:[{type:"error-encountered"},{type:"test-result"}],threshold:.5},security:{symbols:["^*","#*-auth","#*-middleware"],paths:["auth/**","middleware/**","guards/**"],concepts:["permission","JWT","session","RBAC","XSS","injection"],signals:[{type:"gate-added"},{type:"route-created"},{type:"gate-checked"},{type:"compliance-violation"}],threshold:.4},documentor:{paths:["**/.purpose","**/portal.yaml",".paradigm/**"],concepts:["purpose","portal","symbol","documentation","component","gate","flow"],signals:[{type:"file-modified"},{type:"compliance-violation"},{type:"work-completed"}],threshold:.3}},w={architect:{stance:"lead",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},builder:{stance:"supportive",with:{architect:{stance:"supportive",can_contradict:false}}},reviewer:{stance:"advisory",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},tester:{stance:"supportive",debate:{will_challenge:false,evidence_required:true,escalate_to_human:false}},security:{stance:"advisory",with:{architect:{stance:"peer",can_contradict:true},builder:{stance:"advisory",review_output:true}},debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},documentor:{stance:"supportive",with:{architect:{stance:"supportive"},builder:{stance:"supportive"},reviewer:{stance:"supportive"},security:{stance:"supportive"}},debate:{will_challenge:false,evidence_required:false,escalate_to_human:false}}};var y=u.join(S.homedir(),".paradigm","agents"),x=".paradigm/agents",h=".agent",T=".paradigm/roster.yaml",b=.3,L=60,$=7,N=.2;function m(e,t){let o=(Date.now()-new Date(t).getTime())/(1e3*60*60*24);if(o<=$)return e;let r=Math.pow(.5,(o-$)/L);return e*r}function F(e){let t=u.join(e,T);if(!l.existsSync(t))return null;try{return d.load(l.readFileSync(t,"utf8"))?.active??null}catch{return null}}function W(e,t){let i=F(t);return i?i.includes(e):true}function U(e,t){let i=u.join(e,T),o=u.dirname(i);l.existsSync(o)||l.mkdirSync(o,{recursive:true});let r={version:"1.0",active:t.sort()};l.writeFileSync(i,d.dump(r,{lineWidth:-1,noRefs:true}),"utf8");}function H(){if(!l.existsSync(y))return [];try{return l.readdirSync(y).filter(e=>e.endsWith(h)).map(e=>e.replace(h,""))}catch{return []}}function j(e,t){let i=u.join(e,x,`${t}${h}`);if(l.existsSync(i))try{let r=l.readFileSync(i,"utf-8");return d.load(r)}catch{}let o=u.join(y,`${t}${h}`);if(l.existsSync(o))try{let r=l.readFileSync(o,"utf-8"),n=d.load(r);if(l.existsSync(i))try{let a=l.readFileSync(i,"utf-8"),f=d.load(a);return R(n,f)}catch{}return n}catch{}return null}function O(e){let t=new Map;if(l.existsSync(y))try{let o=l.readdirSync(y).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(y,r),"utf-8"),a=d.load(n);a?.id&&t.set(a.id,a);}catch{}}catch{}let i=u.join(e,x);if(l.existsSync(i))try{let o=l.readdirSync(i).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(i,r),"utf-8"),a=d.load(n);if(!a?.id)continue;let f=t.get(a.id);f?t.set(a.id,R(f,a)):t.set(a.id,a);}catch{}}catch{}return Array.from(t.values())}function _(e,t,i,o){let r=i==="global"?y:u.join(o||process.cwd(),x);l.existsSync(r)||l.mkdirSync(r,{recursive:true});let n=u.join(r,`${e}${h}`);t.permissions&&(t.integrityHash=E(t)),t.updated=new Date().toISOString();let a=d.dump(t,{lineWidth:120,noRefs:true,sortKeys:false});return l.writeFileSync(n,a,"utf-8"),n}function I(e,t={}){let i=new Date().toISOString(),o={id:e,role:t.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:t.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:P[e]||{style:"balanced",risk:"balanced",verbosity:"concise"},expertise:[],transferable:[],contexts:{},created:i,updated:i};P[e]||(o.personality={style:"deliberate",risk:"balanced",verbosity:"concise"}),v[e]&&(o.attention={...v[e]}),w[e]&&(o.collaboration={...w[e]});let r=t.scope||"global",n=_(e,o,r,t.rootDir);return {profile:o,filePath:n}}function G(e,t){let i=O(e),o=[];for(let r of i){let n=(r.expertise||[]).find(a=>a.symbol===t);n&&o.push({agentId:r.id,entry:n});}return o.sort((r,n)=>m(n.entry.confidence,n.entry.lastTouch)-m(r.entry.confidence,r.entry.lastTouch))}function Y(e,t,i){let o=j(e,t);if(!o)return false;let r=new Date().toISOString(),n=o.expertise||[];for(let c of i.symbols_touched){let p=n.find(g=>g.symbol===c);p?(p.sessions++,p.lastTouch=r,i.confidence!=null&&(p.confidence=(1-b)*p.confidence+b*i.confidence)):n.push({symbol:c,confidence:i.confidence??.5,sessions:1,lastTouch:r});}o.expertise=n;let a=D(e);if(a){let c=o.contexts[a]||{focus:[],sessionsInProject:0};c.lastActive=r,c.sessionsInProject=(c.sessionsInProject||0)+1,o.contexts[a]=c;}let f=u.join(e,x,`${t}${h}`),s=l.existsSync(f)?"project":"global";return _(t,o,s,e),true}function B(e,t,i){let o=j(e,t);if(!o)return false;let n={correct:1,partial:.5,incorrect:0}[i.verdict];for(let s of i.symbols_touched){let c=(o.expertise||[]).find(p=>p.symbol===s);c&&(c.confidence=(1-b)*c.confidence+b*n);}let a=u.join(e,x,`${t}${h}`),f=l.existsSync(a)?"project":"global";return _(t,o,f,e),true}function J(e,t,i){return t?{personality:t.personality||null,topExpertise:(t.expertise||[]).sort((o,r)=>m(r.confidence,r.lastTouch)-m(o.confidence,o.lastTouch)).slice(0,10),projectContext:t.contexts?.[i]||null,transferablePatterns:(t.transferable||[]).filter(o=>o.successRate>=.7).map(o=>({id:o.id,description:o.description,successRate:o.successRate}))}:{personality:null,topExpertise:[],projectContext:null,transferablePatterns:[]}}function z(e,t,i,o,r){let n=[];if(e.personality){let s=e.personality;n.push(`## Agent Identity: ${e.id}`),n.push(`**Style:** ${s.style} | **Risk:** ${s.risk} | **Verbosity:** ${s.verbosity}`),n.push("");}let a=(e.expertise||[]).filter(s=>t.length===0||t.includes(s.symbol)).sort((s,c)=>m(c.confidence,c.lastTouch)-m(s.confidence,s.lastTouch)).slice(0,8);if(a.length>0){n.push("## Your Expertise on Relevant Symbols");for(let s of a){let p=1-m(s.confidence,s.lastTouch)/s.confidence,g=s.confidence>0&&p>N?" (aging)":"";n.push(`- \`${s.symbol}\`: confidence ${s.confidence.toFixed(2)} (${s.sessions} sessions)${g}`);}n.push("");}let f=(e.transferable||[]).filter(s=>s.successRate>=.7);if(f.length>0){n.push("## Transferable Patterns");for(let s of f){let c=s.appliedIn?.length||0;n.push(`- ${s.id}: ${(s.successRate*100).toFixed(0)}% success (learned in ${s.learnedIn}${c>0?`, applied in ${c} projects`:""})`);}n.push("");}if(i&&i.length>0){n.push("## Relevant Notebook Entries");for(let s of i.slice(0,5)){n.push(`### ${s.context}`),n.push(`Concepts: ${s.concepts.join(", ")}`),n.push("```");let c=s.snippet.length>300?s.snippet.slice(0,300)+"...":s.snippet;n.push(c),n.push("```"),n.push("");}}if(r){if(n.push(""),n.push("## Your Recent Work on This Project"),r.lastSession){let s=Date.now()-new Date(r.lastSession.date).getTime(),c=Math.floor(s/(3600*1e3)),p=c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`;n.push(`Last session (${p}): ${r.lastSession.summary}`);}if(r.sessionsOnProject&&n.push(`Sessions on this project: ${r.sessionsOnProject}`),r.pendingWork?.length){n.push("**Pending from last session:**");for(let s of r.pendingWork.slice(0,5))n.push(`- ${s}`);}if(r.recentPatterns?.length){n.push("**Project patterns you've learned:**");for(let s of r.recentPatterns.slice(0,5))n.push(`- ${s}`);}n.push("");}if(e.attention){let s=e.attention,c=[];s.symbols?.length&&c.push(`Symbols: ${s.symbols.join(", ")}`),s.paths?.length&&c.push(`Paths: ${s.paths.join(", ")}`),s.concepts?.length&&c.push(`Concepts: ${s.concepts.join(", ")}`),s.signals?.length&&c.push(`Signals: ${s.signals.map(p=>p.type).join(", ")}`),c.length>0&&(n.push(""),n.push("### Attention"),n.push(`Threshold: ${s.threshold??.6}`),n.push(c.join(" | ")));}if(e.collaboration){let s=e.collaboration;if(n.push(""),n.push("### Collaboration"),n.push(`Default stance: ${s.stance||"supportive"}`),s.with)for(let[c,p]of Object.entries(s.with)){let g=[`${c}: ${p.stance||"peer"}`];p.can_contradict&&g.push("can contradict"),p.review_output&&g.push("reviews output"),n.push(`- ${g.join(", ")}`);}if(s.debate){let c=s.debate,p=[];c.will_challenge&&p.push("challenges"),c.evidence_required&&p.push("evidence-based"),c.escalate_to_human&&p.push("escalates to human"),p.length&&n.push(`Debate: ${p.join(", ")}`);}}if(e.nomination){let s=e.nomination;if(n.push(""),n.push("### Nomination"),s.speak_when?.urgency?.length&&n.push(`Always speaks on: ${s.speak_when.urgency.join(", ")}`),s.contribution_style){let c=[];s.contribution_style.brief_first&&c.push("brief first"),s.contribution_style.cite_sources&&c.push("cites sources"),s.contribution_style.offer_action&&c.push("offers action"),c.length&&n.push(`Style: ${c.join(", ")}`);}}if(o){if(o.recentDecisions?.length){n.push(""),n.push("## Recent Team Decisions");for(let s of o.recentDecisions.slice(0,5))n.push(`- **${s.title}**: ${s.decision.slice(0,150)}${s.decision.length>150?"...":""}`);}if(o.journalInsights?.length){n.push(""),n.push("## Transferable Insights");for(let s of o.journalInsights.slice(0,5))n.push(`- [${s.trigger}] ${s.insight.slice(0,150)}${s.insight.length>150?"...":""}`);}if(o.pendingNominations?.length){n.push(""),n.push("## Pending Nominations");for(let s of o.pendingNominations.slice(0,10))n.push(`- [${s.urgency}] ${s.brief}`);}}return n.join(`
|
|
3
|
-
`)}async function X(e,t,i=false){let{loadLoreEntries:o}=await import('./lore-loader-XY5MZRR2.js'),r=await o(e,{limit:500}),n=0,a=new Set,f=j(e,t)||I(t,{rootDir:e}).profile,s=f.expertise||[];for(let c of r)if(!(!c.symbols_touched||c.symbols_touched.length===0)){n++;for(let p of c.symbols_touched){a.add(p);let g=s.find(C=>C.symbol===p);g?(g.sessions++,g.lastTouch=c.timestamp,c.confidence!=null&&(g.confidence=(1-b)*g.confidence+b*c.confidence)):s.push({symbol:p,confidence:c.confidence??.5,sessions:1,lastTouch:c.timestamp});}}if(f.expertise=s,!i){let c=u.join(e,x,`${t}${h}`),p=l.existsSync(c)?"project":"global";_(t,f,p,e);}return {entriesProcessed:n,symbolsUpdated:a.size}}function K(e,t,i){if(!e.permissions?.paths)return {allowed:true};let{read:o,write:r,deny:n}=e.permissions.paths;if(n&&n.length>0){for(let f of n)if(A(f,t))return {allowed:false,reason:`Path denied by pattern: ${f}`}}let a=i==="read"?o:r;if(a&&a.length>0){for(let f of a)if(A(f,t))return {allowed:true};return {allowed:false,reason:`No ${i} pattern matches: ${t}`}}return {allowed:true}}function V(e,t){if(!e.permissions?.tools)return {allowed:true};let{allow:i,deny:o}=e.permissions.tools;if(o&&o.length>0){for(let r of o)if(A(r,t))return {allowed:false,reason:`Tool denied by pattern: ${r}`}}if(i&&i.length>0){for(let r of i)if(A(r,t))return {allowed:true};return {allowed:false,reason:`Tool not in allow list: ${t}`}}return {allowed:true}}function E(e){let t=JSON.stringify({id:e.id,role:e.role,permissions:e.permissions||null});return k.createHash("sha256").update(t).digest("hex")}function Q(e){return e.integrityHash?E(e)===e.integrityHash?{valid:true}:{valid:false,reason:"Integrity hash mismatch \u2014 profile may have been tampered with"}:{valid:true,reason:"No integrity hash stored (pre-4.0 profile)"}}function A(e,t){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}function R(e,t){let i={...e};if(t.role&&(i.role=t.role),t.description&&(i.description=t.description),t.version&&(i.version=t.version),t.personality&&(i.personality={...e.personality,...t.personality}),t.expertise){let o=new Map(e.expertise.map(r=>[r.symbol,r]));for(let r of t.expertise)o.set(r.symbol,r);i.expertise=Array.from(o.values());}if(t.transferable){let o=new Map(e.transferable.map(r=>[r.id,r]));for(let r of t.transferable)o.set(r.id,r);i.transferable=Array.from(o.values());}if(t.contexts){i.contexts={...e.contexts};for(let[o,r]of Object.entries(t.contexts))i.contexts[o]={...i.contexts[o],...r};}return i}function D(e){try{let t=u.join(e,".paradigm","config.yaml");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8"),o=d.load(i);if(o?.project&&typeof o.project=="string")return o.project}}catch{}return u.basename(e)}export{m as a,F as b,W as c,U as d,H as e,j as f,O as g,_ as h,I as i,G as j,Y as k,B as l,J as m,z as n,X as o,K as p,V as q,E as r,Q as s};
|
package/dist/chunk-ZMQXXFG2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {b as b$1}from'./chunk-5TAVYPOV.js';import*as l from'fs';import*as u from'path';import*as T from'os';import*as E from'crypto';import*as d from'js-yaml';var P,v,w,S=b$1(()=>{P={architect:{style:"deliberate",risk:"conservative",verbosity:"detailed"},builder:{style:"rapid",risk:"balanced",verbosity:"concise"},tester:{style:"methodical",risk:"conservative",verbosity:"concise"},reviewer:{style:"deliberate",risk:"conservative",verbosity:"detailed"},security:{style:"methodical",risk:"conservative",verbosity:"detailed"},documentor:{style:"methodical",risk:"conservative",verbosity:"concise"}},v={architect:{symbols:["$*","#*"],concepts:["architecture","design","pattern","refactor"],signals:[{type:"flow-modified"},{type:"compliance-violation"}],threshold:.5},builder:{paths:["src/**","lib/**","packages/**"],signals:[{type:"file-modified"},{type:"error-encountered"}],threshold:.7},reviewer:{concepts:["code quality","bug","smell","convention"],signals:[{type:"compliance-violation"}],threshold:.6},tester:{paths:["**/*.test.*","**/*.spec.*"],concepts:["test","coverage","assertion"],signals:[{type:"error-encountered"},{type:"test-result"}],threshold:.5},security:{symbols:["^*","#*-auth","#*-middleware"],paths:["auth/**","middleware/**","guards/**"],concepts:["permission","JWT","session","RBAC","XSS","injection"],signals:[{type:"gate-added"},{type:"route-created"},{type:"gate-checked"},{type:"compliance-violation"}],threshold:.4},documentor:{paths:["**/.purpose","**/portal.yaml",".paradigm/**"],concepts:["purpose","portal","symbol","documentation","component","gate","flow"],signals:[{type:"file-modified"},{type:"compliance-violation"},{type:"work-completed"}],threshold:.3}},w={architect:{stance:"lead",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},builder:{stance:"supportive",with:{architect:{stance:"supportive",can_contradict:false}}},reviewer:{stance:"advisory",debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},tester:{stance:"supportive",debate:{will_challenge:false,evidence_required:true,escalate_to_human:false}},security:{stance:"advisory",with:{architect:{stance:"peer",can_contradict:true},builder:{stance:"advisory",review_output:true}},debate:{will_challenge:true,evidence_required:true,escalate_to_human:true}},documentor:{stance:"supportive",with:{architect:{stance:"supportive"},builder:{stance:"supportive"},reviewer:{stance:"supportive"},security:{stance:"supportive"}},debate:{will_challenge:false,evidence_required:false,escalate_to_human:false}}};});function m(e,t){let o=(Date.now()-new Date(t).getTime())/(1e3*60*60*24);if(o<=k)return e;let r=Math.pow(.5,(o-k)/F);return e*r}function I(e){let t=u.join(e,R);if(!l.existsSync(t))return null;try{return d.load(l.readFileSync(t,"utf8"))?.active??null}catch{return null}}function G(e,t){let i=I(t);return i?i.includes(e):true}function Y(e,t){let i=u.join(e,R),o=u.dirname(i);l.existsSync(o)||l.mkdirSync(o,{recursive:true});let r={version:"1.0",active:t.sort()};l.writeFileSync(i,d.dump(r,{lineWidth:-1,noRefs:true}),"utf8");}function B(){if(!l.existsSync(y))return [];try{return l.readdirSync(y).filter(e=>e.endsWith(h)).map(e=>e.replace(h,""))}catch{return []}}function j(e,t){let i=u.join(e,x,`${t}${h}`);if(l.existsSync(i))try{let r=l.readFileSync(i,"utf-8");return d.load(r)}catch{}let o=u.join(y,`${t}${h}`);if(l.existsSync(o))try{let r=l.readFileSync(o,"utf-8"),n=d.load(r);if(l.existsSync(i))try{let a=l.readFileSync(i,"utf-8"),f=d.load(a);return L(n,f)}catch{}return n}catch{}return null}function D(e){let t=new Map;if(l.existsSync(y))try{let o=l.readdirSync(y).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(y,r),"utf-8"),a=d.load(n);a?.id&&t.set(a.id,a);}catch{}}catch{}let i=u.join(e,x);if(l.existsSync(i))try{let o=l.readdirSync(i).filter(r=>r.endsWith(h));for(let r of o)try{let n=l.readFileSync(u.join(i,r),"utf-8"),a=d.load(n);if(!a?.id)continue;let f=t.get(a.id);f?t.set(a.id,L(f,a)):t.set(a.id,a);}catch{}}catch{}return Array.from(t.values())}function _(e,t,i,o){let r=i==="global"?y:u.join(o||process.cwd(),x);l.existsSync(r)||l.mkdirSync(r,{recursive:true});let n=u.join(r,`${e}${h}`);t.permissions&&(t.integrityHash=C(t)),t.updated=new Date().toISOString();let a=d.dump(t,{lineWidth:120,noRefs:true,sortKeys:false});return l.writeFileSync(n,a,"utf-8"),n}function M(e,t={}){let i=new Date().toISOString(),o={id:e,role:t.role||`${e.charAt(0).toUpperCase()+e.slice(1)} agent`,description:t.description||`Persistent identity for the ${e} agent role`,version:"1.0.0",personality:P[e]||{style:"balanced",risk:"balanced",verbosity:"concise"},expertise:[],transferable:[],contexts:{},created:i,updated:i};P[e]||(o.personality={style:"deliberate",risk:"balanced",verbosity:"concise"}),v[e]&&(o.attention={...v[e]}),w[e]&&(o.collaboration={...w[e]});let r=t.scope||"global",n=_(e,o,r,t.rootDir);return {profile:o,filePath:n}}function J(e,t){let i=D(e),o=[];for(let r of i){let n=(r.expertise||[]).find(a=>a.symbol===t);n&&o.push({agentId:r.id,entry:n});}return o.sort((r,n)=>m(n.entry.confidence,n.entry.lastTouch)-m(r.entry.confidence,r.entry.lastTouch))}function z(e,t,i){let o=j(e,t);if(!o)return false;let r=new Date().toISOString(),n=o.expertise||[];for(let c of i.symbols_touched){let p=n.find(g=>g.symbol===c);p?(p.sessions++,p.lastTouch=r,i.confidence!=null&&(p.confidence=(1-b)*p.confidence+b*i.confidence)):n.push({symbol:c,confidence:i.confidence??.5,sessions:1,lastTouch:r});}o.expertise=n;let a=q(e);if(a){let c=o.contexts[a]||{focus:[],sessionsInProject:0};c.lastActive=r,c.sessionsInProject=(c.sessionsInProject||0)+1,o.contexts[a]=c;}let f=u.join(e,x,`${t}${h}`),s=l.existsSync(f)?"project":"global";return _(t,o,s,e),true}function X(e,t,i){let o=j(e,t);if(!o)return false;let n={correct:1,partial:.5,incorrect:0}[i.verdict];for(let s of i.symbols_touched){let c=(o.expertise||[]).find(p=>p.symbol===s);c&&(c.confidence=(1-b)*c.confidence+b*n);}let a=u.join(e,x,`${t}${h}`),f=l.existsSync(a)?"project":"global";return _(t,o,f,e),true}function K(e,t,i){return t?{personality:t.personality||null,topExpertise:(t.expertise||[]).sort((o,r)=>m(r.confidence,r.lastTouch)-m(o.confidence,o.lastTouch)).slice(0,10),projectContext:t.contexts?.[i]||null,transferablePatterns:(t.transferable||[]).filter(o=>o.successRate>=.7).map(o=>({id:o.id,description:o.description,successRate:o.successRate}))}:{personality:null,topExpertise:[],projectContext:null,transferablePatterns:[]}}function V(e,t,i,o,r){let n=[];if(e.personality){let s=e.personality;n.push(`## Agent Identity: ${e.id}`),n.push(`**Style:** ${s.style} | **Risk:** ${s.risk} | **Verbosity:** ${s.verbosity}`),n.push("");}let a=(e.expertise||[]).filter(s=>t.length===0||t.includes(s.symbol)).sort((s,c)=>m(c.confidence,c.lastTouch)-m(s.confidence,s.lastTouch)).slice(0,8);if(a.length>0){n.push("## Your Expertise on Relevant Symbols");for(let s of a){let p=1-m(s.confidence,s.lastTouch)/s.confidence,g=s.confidence>0&&p>O?" (aging)":"";n.push(`- \`${s.symbol}\`: confidence ${s.confidence.toFixed(2)} (${s.sessions} sessions)${g}`);}n.push("");}let f=(e.transferable||[]).filter(s=>s.successRate>=.7);if(f.length>0){n.push("## Transferable Patterns");for(let s of f){let c=s.appliedIn?.length||0;n.push(`- ${s.id}: ${(s.successRate*100).toFixed(0)}% success (learned in ${s.learnedIn}${c>0?`, applied in ${c} projects`:""})`);}n.push("");}if(i&&i.length>0){n.push("## Relevant Notebook Entries");for(let s of i.slice(0,5)){n.push(`### ${s.context}`),n.push(`Concepts: ${s.concepts.join(", ")}`),n.push("```");let c=s.snippet.length>300?s.snippet.slice(0,300)+"...":s.snippet;n.push(c),n.push("```"),n.push("");}}if(r){if(n.push(""),n.push("## Your Recent Work on This Project"),r.lastSession){let s=Date.now()-new Date(r.lastSession.date).getTime(),c=Math.floor(s/(3600*1e3)),p=c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`;n.push(`Last session (${p}): ${r.lastSession.summary}`);}if(r.sessionsOnProject&&n.push(`Sessions on this project: ${r.sessionsOnProject}`),r.pendingWork?.length){n.push("**Pending from last session:**");for(let s of r.pendingWork.slice(0,5))n.push(`- ${s}`);}if(r.recentPatterns?.length){n.push("**Project patterns you've learned:**");for(let s of r.recentPatterns.slice(0,5))n.push(`- ${s}`);}n.push("");}if(e.attention){let s=e.attention,c=[];s.symbols?.length&&c.push(`Symbols: ${s.symbols.join(", ")}`),s.paths?.length&&c.push(`Paths: ${s.paths.join(", ")}`),s.concepts?.length&&c.push(`Concepts: ${s.concepts.join(", ")}`),s.signals?.length&&c.push(`Signals: ${s.signals.map(p=>p.type).join(", ")}`),c.length>0&&(n.push(""),n.push("### Attention"),n.push(`Threshold: ${s.threshold??.6}`),n.push(c.join(" | ")));}if(e.collaboration){let s=e.collaboration;if(n.push(""),n.push("### Collaboration"),n.push(`Default stance: ${s.stance||"supportive"}`),s.with)for(let[c,p]of Object.entries(s.with)){let g=[`${c}: ${p.stance||"peer"}`];p.can_contradict&&g.push("can contradict"),p.review_output&&g.push("reviews output"),n.push(`- ${g.join(", ")}`);}if(s.debate){let c=s.debate,p=[];c.will_challenge&&p.push("challenges"),c.evidence_required&&p.push("evidence-based"),c.escalate_to_human&&p.push("escalates to human"),p.length&&n.push(`Debate: ${p.join(", ")}`);}}if(e.nomination){let s=e.nomination;if(n.push(""),n.push("### Nomination"),s.speak_when?.urgency?.length&&n.push(`Always speaks on: ${s.speak_when.urgency.join(", ")}`),s.contribution_style){let c=[];s.contribution_style.brief_first&&c.push("brief first"),s.contribution_style.cite_sources&&c.push("cites sources"),s.contribution_style.offer_action&&c.push("offers action"),c.length&&n.push(`Style: ${c.join(", ")}`);}}if(o){if(o.recentDecisions?.length){n.push(""),n.push("## Recent Team Decisions");for(let s of o.recentDecisions.slice(0,5))n.push(`- **${s.title}**: ${s.decision.slice(0,150)}${s.decision.length>150?"...":""}`);}if(o.journalInsights?.length){n.push(""),n.push("## Transferable Insights");for(let s of o.journalInsights.slice(0,5))n.push(`- [${s.trigger}] ${s.insight.slice(0,150)}${s.insight.length>150?"...":""}`);}if(o.pendingNominations?.length){n.push(""),n.push("## Pending Nominations");for(let s of o.pendingNominations.slice(0,10))n.push(`- [${s.urgency}] ${s.brief}`);}}return n.join(`
|
|
3
|
-
`)}async function Q(e,t,i=false){let{loadLoreEntries:o}=await import('./lore-loader-RVQI5GXL.js'),r=await o(e,{limit:500}),n=0,a=new Set,f=j(e,t)||M(t,{rootDir:e}).profile,s=f.expertise||[];for(let c of r)if(!(!c.symbols_touched||c.symbols_touched.length===0)){n++;for(let p of c.symbols_touched){a.add(p);let g=s.find(N=>N.symbol===p);g?(g.sessions++,g.lastTouch=c.timestamp,c.confidence!=null&&(g.confidence=(1-b)*g.confidence+b*c.confidence)):s.push({symbol:p,confidence:c.confidence??.5,sessions:1,lastTouch:c.timestamp});}}if(f.expertise=s,!i){let c=u.join(e,x,`${t}${h}`),p=l.existsSync(c)?"project":"global";_(t,f,p,e);}return {entriesProcessed:n,symbolsUpdated:a.size}}function Z(e,t,i){if(!e.permissions?.paths)return {allowed:true};let{read:o,write:r,deny:n}=e.permissions.paths;if(n&&n.length>0){for(let f of n)if(A(f,t))return {allowed:false,reason:`Path denied by pattern: ${f}`}}let a=i==="read"?o:r;if(a&&a.length>0){for(let f of a)if(A(f,t))return {allowed:true};return {allowed:false,reason:`No ${i} pattern matches: ${t}`}}return {allowed:true}}function ee(e,t){if(!e.permissions?.tools)return {allowed:true};let{allow:i,deny:o}=e.permissions.tools;if(o&&o.length>0){for(let r of o)if(A(r,t))return {allowed:false,reason:`Tool denied by pattern: ${r}`}}if(i&&i.length>0){for(let r of i)if(A(r,t))return {allowed:true};return {allowed:false,reason:`Tool not in allow list: ${t}`}}return {allowed:true}}function C(e){let t=JSON.stringify({id:e.id,role:e.role,permissions:e.permissions||null});return E.createHash("sha256").update(t).digest("hex")}function te(e){return e.integrityHash?C(e)===e.integrityHash?{valid:true}:{valid:false,reason:"Integrity hash mismatch \u2014 profile may have been tampered with"}:{valid:true,reason:"No integrity hash stored (pre-4.0 profile)"}}function A(e,t){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(t)}function L(e,t){let i={...e};if(t.role&&(i.role=t.role),t.description&&(i.description=t.description),t.version&&(i.version=t.version),t.personality&&(i.personality={...e.personality,...t.personality}),t.expertise){let o=new Map(e.expertise.map(r=>[r.symbol,r]));for(let r of t.expertise)o.set(r.symbol,r);i.expertise=Array.from(o.values());}if(t.transferable){let o=new Map(e.transferable.map(r=>[r.id,r]));for(let r of t.transferable)o.set(r.id,r);i.transferable=Array.from(o.values());}if(t.contexts){i.contexts={...e.contexts};for(let[o,r]of Object.entries(t.contexts))i.contexts[o]={...i.contexts[o],...r};}return i}function q(e){try{let t=u.join(e,".paradigm","config.yaml");if(l.existsSync(t)){let i=l.readFileSync(t,"utf-8"),o=d.load(i);if(o?.project&&typeof o.project=="string")return o.project}}catch{}return u.basename(e)}var y,x,h,R,b,F,k,O,W=b$1(()=>{S();y=u.join(T.homedir(),".paradigm","agents"),x=".paradigm/agents",h=".agent",R=".paradigm/roster.yaml",b=.3,F=60,k=7,O=.2;});export{m as a,I as b,G as c,Y as d,B as e,j as f,D as g,_ as h,M as i,J as j,z as k,X as l,K as m,V as n,Q as o,Z as p,ee as q,C as r,te as s,W as t};
|
package/dist/reindex-HA3CJG7S.js
DELETED