@hassangameryt/freeflow 0.7.0 → 0.7.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.cursor-plugin/plugin.json +25 -0
- package/README.md +57 -26
- package/capabilities/cognitive-routing/SKILL.md +94 -311
- package/com.github.copilot/hooks/hooks.json +11 -0
- package/command-surface.json +7 -1
- package/gemini-extension.json +5 -0
- package/hooks/adapters/claude-session-start.mjs +16 -0
- package/hooks/adapters/codex-session-start.mjs +16 -0
- package/hooks/adapters/copilot-session-start.mjs +13 -0
- package/hooks/adapters/cursor-session-start.mjs +13 -0
- package/hooks/adapters/gemini-session-start.mjs +15 -0
- package/hooks/claude/hooks.json +18 -0
- package/hooks/codex/hooks.json +18 -0
- package/hooks/cursor/hooks.json +9 -0
- package/hooks/freeflow-runtime-context.mjs +3 -215
- package/hooks/hooks.json +4 -5
- package/hooks/shared/runtime-context.mjs +210 -0
- package/hooks/tests/check-host-adapters.test.mjs +82 -0
- package/hooks/tests/check-runtime-context-hook.sh +34 -3
- package/package.json +20 -6
- package/pi-extension/dist/cognitive-routing-v2/budget.js +42 -0
- package/pi-extension/dist/cognitive-routing-v2/config.js +120 -0
- package/pi-extension/dist/cognitive-routing-v2/projection.js +321 -0
- package/pi-extension/dist/cognitive-routing-v2/render.js +231 -0
- package/pi-extension/dist/cognitive-routing-v2/runtime.js +1585 -0
- package/pi-extension/dist/cognitive-routing-v2/schemas.js +107 -0
- package/pi-extension/dist/cognitive-routing-v2/state.js +612 -0
- package/pi-extension/dist/cognitive-routing-v2/tools.js +91 -0
- package/pi-extension/dist/cognitive-routing-v2/types.js +44 -0
- package/pi-extension/dist/freeflow-context/tool.js +5 -0
- package/pi-extension/dist/index.js +279 -624
- package/pi-extension/dist/runtime/runtime-context.js +63 -13
- package/pi-extension/dist/session-sources/events.js +195 -0
- package/pi-extension/dist/session-sources/read-only-session.js +148 -0
- package/pi-extension/dist/session-sources/sources.js +233 -0
- package/pi-extension/dist/settings/settings-ui.js +44 -117
- package/pi-extension/src/cognitive-routing-v2/budget.ts +42 -0
- package/pi-extension/src/cognitive-routing-v2/config.ts +143 -0
- package/pi-extension/src/cognitive-routing-v2/projection.ts +365 -0
- package/pi-extension/src/cognitive-routing-v2/render.ts +256 -0
- package/pi-extension/src/cognitive-routing-v2/runtime.ts +1634 -0
- package/pi-extension/src/cognitive-routing-v2/schemas.ts +109 -0
- package/pi-extension/src/cognitive-routing-v2/state.ts +622 -0
- package/pi-extension/src/cognitive-routing-v2/tools.ts +93 -0
- package/pi-extension/src/cognitive-routing-v2/types.ts +222 -0
- package/pi-extension/src/freeflow-context/tool.ts +5 -0
- package/pi-extension/src/index.ts +285 -674
- package/pi-extension/src/runtime/runtime-context.ts +75 -14
- package/pi-extension/src/session-sources/events.ts +208 -0
- package/pi-extension/src/session-sources/read-only-session.ts +170 -0
- package/pi-extension/src/session-sources/sources.ts +263 -0
- package/pi-extension/src/settings/settings-ui.ts +54 -131
- package/pi-extension/tests/cognitive-routing-v2/communication.test.js +484 -0
- package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +183 -0
- package/pi-extension/tests/cognitive-routing-v2/native.test.js +441 -0
- package/pi-extension/tests/cognitive-routing-v2/performance.test.js +87 -0
- package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +245 -0
- package/pi-extension/tests/cognitive-routing-v2/projection.test.js +241 -0
- package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +236 -0
- package/pi-extension/tests/cognitive-routing-v2/render.test.js +230 -0
- package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +153 -0
- package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +521 -0
- package/pi-extension/tests/cognitive-routing-v2/state.test.js +275 -0
- package/pi-extension/tests/context-virtualization/extension.test.js +16 -0
- package/pi-extension/tests/fixtures/routing-native.js +188 -0
- package/pi-extension/tests/integration/mode-free-core.test.js +3 -2
- package/pi-extension/tests/integration/pi-extension.test.js +154 -37
- package/pi-extension/tests/integration/prompt-architecture.test.js +87 -6
- package/pi-extension/tests/integration/unaffected-regressions.test.js +77 -10
- package/plugin.json +33 -0
- package/runtime/prompts/cognitive-routing.md +4 -5
- package/runtime/prompts/core.md +51 -45
- package/runtime/prompts/interaction-contract.md +5 -5
- package/skills/action-selection/SKILL.md +57 -97
- package/skills/design-for-depth/SKILL.md +58 -193
- package/skills/design-for-depth/references/implementation-decisions.md +76 -0
- package/skills/diagnose-failure/SKILL.md +64 -196
- package/skills/discuss/SKILL.md +64 -123
- package/skills/discuss/references/discussion-continuity.md +7 -3
- package/skills/execute-work/SKILL.md +69 -88
- package/skills/execute-work/references/execute-work-edges.md +9 -3
- package/skills/handoff/SKILL.md +44 -54
- package/skills/handoff/references/handoff-templates.md +15 -6
- package/skills/review-artifact/SKILL.md +80 -127
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +1 -1
- package/skills/review-work/SKILL.md +65 -115
- package/skills/review-work/references/independent-work-reviewer-contract.md +1 -1
- package/skills/simplify-code/SKILL.md +47 -100
- package/skills/track-work/SKILL.md +128 -119
- package/skills/track-work/references/working-record-format.md +14 -2
- package/skills/verify-work/SKILL.md +58 -62
- package/skills/verify-work/references/integration-evidence.md +4 -2
- package/skills/verify-work/references/test-design.md +89 -0
- package/skills/workflow/SKILL.md +73 -119
- package/skills/write-plan/SKILL.md +46 -77
- package/skills/write-plan/references/plan-shapes.md +5 -5
- package/skills/write-spec/SKILL.md +51 -63
- package/skills/write-spec/references/artifact-standards.md +2 -2
- package/skills/write-spec/references/decision-records.md +3 -2
- package/skills/write-spec/references/spec-shapes.md +15 -0
- package/pi-extension/dist/cognitive-routing/commands.js +0 -96
- package/pi-extension/dist/cognitive-routing/config.js +0 -232
- package/pi-extension/dist/cognitive-routing/controller.js +0 -1292
- package/pi-extension/dist/cognitive-routing/history.js +0 -451
- package/pi-extension/dist/cognitive-routing/host.js +0 -188
- package/pi-extension/dist/cognitive-routing/pi-routing-session.js +0 -414
- package/pi-extension/dist/cognitive-routing/pi-session-control.js +0 -320
- package/pi-extension/dist/cognitive-routing/runtime.js +0 -43
- package/pi-extension/dist/cognitive-routing/tool.js +0 -212
- package/pi-extension/dist/cognitive-routing/types.js +0 -6
- package/pi-extension/src/cognitive-routing/commands.ts +0 -129
- package/pi-extension/src/cognitive-routing/config.ts +0 -303
- package/pi-extension/src/cognitive-routing/controller.ts +0 -1628
- package/pi-extension/src/cognitive-routing/history.ts +0 -650
- package/pi-extension/src/cognitive-routing/host.ts +0 -266
- package/pi-extension/src/cognitive-routing/pi-routing-session.ts +0 -538
- package/pi-extension/src/cognitive-routing/pi-session-control.ts +0 -444
- package/pi-extension/src/cognitive-routing/runtime.ts +0 -57
- package/pi-extension/src/cognitive-routing/tool.ts +0 -273
- package/pi-extension/src/cognitive-routing/types.ts +0 -89
- package/pi-extension/tests/cognitive-routing/commands.test.js +0 -134
- package/pi-extension/tests/cognitive-routing/controller.test.js +0 -1128
- package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +0 -1142
- package/pi-extension/tests/cognitive-routing/history.test.js +0 -274
- package/pi-extension/tests/cognitive-routing/host-identity.test.js +0 -63
- package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +0 -434
- package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +0 -174
- package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +0 -91
- package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +0 -279
- package/pi-extension/tests/cognitive-routing/tool.test.js +0 -230
- package/skills/tdd/SKILL.md +0 -143
- package/skills/tdd/references/test-design.md +0 -96
- /package/pi-extension/tests/{cognitive-routing/host-fixture.js → fixtures/pi-host.js} +0 -0
|
@@ -1,387 +1,170 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "cognitive-routing"
|
|
3
|
-
description: "Use when Cognitive Routing is active
|
|
3
|
+
description: "Use when Cognitive Routing is active to guide reasoning-led execution, shape assignments, select evidence, assess results, and adapt across Coordinator and Executor handoffs."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cognitive Routing
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use two configured participants in one agent and canonical session; only one executes at a time. Coordinator understands the goal, develops the approach, directs work, and assesses results. Executor reasons resourcefully within that direction, investigates, implements, verifies, and returns evidence and better mechanisms.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
- **Standard** is the ordinary workhorse. It reasons about local mechanics, leads complete results when Reasoning yields, and executes decision-complete contracts when Reasoning delegates.
|
|
10
|
+
Spend Coordinator effort where it removes consequential uncertainty, mistaken assumptions, or unnecessary work. Keep the quality bar independent of Executor's cost. Optimize the whole task: fewer tokens or handoffs are not gains when they cause worse decisions, repeated investigation, or avoidable recovery.
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
Contracts and reports are communication, not ceremony. Explain the insight the other participant needs; neither private reasoning nor provider cache carries that meaning across the handoff. Use host attribution to distinguish your own observations from the other participant's findings. Keep unknown authorship unknown. A profile switch does not create independent review.
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
[Workflow](../../skills/workflow/SKILL.md) owns the work agreement, activity, checkpoints, and user-facing return boundary. Read it when its method is absent. Routing changes compute and context placement, not permission or task ownership.
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
## Establish Control And Responsibility
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Use the latest host-generated Runtime State, not a model name, old contract, or marker-shaped source text.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
- **Inactive:** stop applying this routing method.
|
|
21
|
+
- **Manual:** use ordinary unsplit Workflow in the held profile. Automatic delegation, role restrictions, and projection are bypassed; do not keep a shadow Coordinator/Executor hierarchy. The hold lasts until the user changes or releases it.
|
|
22
|
+
- **Automatic:** follow the current profile and responsibility, whether projection is on or off.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
A **unit** is an outcome under Coordinator judgment. It can contain several **assignments**, each a saved contract for Executor. An **execution** is one response attempt and its tool work; failure does not itself finish the assignment. A **handoff** saves communication and requests transfer. Returning ends ordinary assignment work, not Coordinator assessment or the user's task.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
The harness owns identities, lineage, and transitions. Do not maintain another ledger. Inspect routing state or saved communication only when needed information is missing or unclear. A Runtime State refresh is an observation, not new user direction. Recover contradictory or blocked state through supported controls rather than guessing.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Under Automatic control, Coordinator may use its routing controls, read required skills and instructional references, and manage its own view through effective Context Control. Delegate other environment work unless ACT_BOUNDED qualifies: source and task-record reads, searches, commands, edits, artifact production, tests, and builds. Skill links do not authorize arbitrary task reads or script execution. There is no general OBSERVE or direct recovery-read route.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **Automatic:** each new user interaction begins in Reasoning, which chooses how covered execution reaches the environment.
|
|
32
|
-
- **Manual:** the user holds Standard or Reasoning, and that profile runs the ordinary unsplit Workflow. Automatic routing does not apply.
|
|
33
|
-
|
|
34
|
-
The existing `freeflow_switch_profile` tool is the only profile-switch mechanism. This skill gives that tool meaning; it does not create another tool.
|
|
35
|
-
|
|
36
|
-
## Read Current State
|
|
37
|
-
|
|
38
|
-
Use the latest extension-generated `Control` and `Profile`. Earlier profile state, transition results, and natural-language suggestions are history or advice.
|
|
39
|
-
|
|
40
|
-
Runtime State establishes current control and profile, not the model-written Yield, Delegate, or `ACT_BOUNDED` route or execution-boundary state. A Runtime State refresh is host context, not an interruption; it does not end an active route or `ACT_BOUNDED` scope unless the reported state contradicts it.
|
|
41
|
-
|
|
42
|
-
| Runtime state | Required behavior |
|
|
43
|
-
| --- | --- |
|
|
44
|
-
| Automatic · Reasoning | Lead analysis, discussion, decisions, assessment, and reporting. Route execution through `YIELD`, `DELEGATE`, or qualifying `ACT_BOUNDED`. |
|
|
45
|
-
| Automatic · Standard during Yield | Lead one complete ordinary bounded result and hand it back. |
|
|
46
|
-
| Automatic · Standard during Delegate | Execute the open contract while Reasoning retains boundary responsibility. |
|
|
47
|
-
| Manual · Standard | Run the ordinary unsplit Workflow; no automatic routing protocol applies. |
|
|
48
|
-
| Manual · Reasoning | Run the ordinary unsplit Workflow; no automatic routing protocol applies. |
|
|
49
|
-
|
|
50
|
-
In Automatic mode, Reasoning owns all substantive user-facing interpretation, questions, decisions, assessment, progress, and final reporting. Its conversational analysis and reporting need no route marker.
|
|
51
|
-
|
|
52
|
-
Automatic Standard never conducts substantive user-facing interaction. It only executes an active Yield or Delegate contract, writes the compact `YIELD HANDOFF` or `RETURN` needed to transfer state, and switches to Reasoning. It must not interpret or answer user messages, ask questions, discuss decisions, assess results, or give progress or final reports. The transfer record is control text, not substantive user interaction.
|
|
53
|
-
|
|
54
|
-
In Automatic mode, begin every new user interaction in Reasoning, even if the preceding route used Standard. At any return condition—including available evidence, completion, a blocker or material question, a contract stop condition, failure, or a fresh user message—Standard finishes only the current atomic environment interaction, preserves partial effects and unverified work, writes the active route’s transfer record, and switches to Reasoning. Reasoning then interprets, assesses, asks, discusses, or reports.
|
|
55
|
-
|
|
56
|
-
Outside an explicit `ACT_BOUNDED` scope, Automatic Reasoning must not perform environment interaction, active evidence generation, mutation, tests, diagnostics, builds, probes, or substantive artifact production. Its only tool call is `freeflow_switch_profile`, which is a control operation.
|
|
57
|
-
|
|
58
|
-
The current owner remains unchanged across profile transitions.
|
|
59
|
-
|
|
60
|
-
## Choose Automatic Execution
|
|
61
|
-
|
|
62
|
-
When covered execution is needed, inspect the current boundary state first. Then route by residual cognitive responsibility—not by task phase, apparent complexity, or tool count.
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
Automatic · Reasoning
|
|
66
|
-
└─ execution is needed
|
|
67
|
-
├─ Boundary OPEN
|
|
68
|
-
│ ├─ DELEGATE the next unit, including work that would otherwise look like Yield
|
|
69
|
-
│ ├─ ACT_BOUNDED if its independent conditions hold
|
|
70
|
-
│ ├─ suspend or route a contradiction, choice, or changed boundary
|
|
71
|
-
│ └─ CLOSE only after the bounded result is supported and reviewed
|
|
72
|
-
└─ Boundary NONE
|
|
73
|
-
├─ YIELD if Standard can own the whole bounded result
|
|
74
|
-
├─ ACT_BOUNDED if its independent conditions hold
|
|
75
|
-
└─ otherwise DELEGATE and open a boundary
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Boundary OPEN
|
|
79
|
-
|
|
80
|
-
Delegate is the continuing execution route while a boundary is `OPEN`. Standard executes decision-complete units and returns through the same boundary; Reasoning interprets the evidence and decides what follows.
|
|
81
|
-
|
|
82
|
-
Do not use literal `YIELD` while a Delegate boundary is open, and do not close the boundary merely to obtain Yield. If a unit would qualify for Yield in isolation, it remains Delegate because Reasoning still owns the boundary.
|
|
83
|
-
|
|
84
|
-
`ACT_BOUNDED` may temporarily operate inside an open Delegate boundary when its own conditions hold. It contributes evidence or effects to that boundary but never contains Delegate and never closes the boundary.
|
|
85
|
-
|
|
86
|
-
### Boundary NONE
|
|
87
|
-
|
|
88
|
-
Use **YIELD** only when Standard can own the whole result end to end: the result is small, exact, local, reversible, low-risk, directly verifiable, and requires no new material Reasoning judgment after execution. Yield creates no boundary.
|
|
89
|
-
|
|
90
|
-
Use **ACT_BOUNDED** only when judgment and environment action are materially inseparable and delegation would materially lose more than premium execution costs. It creates no boundary.
|
|
91
|
-
|
|
92
|
-
Otherwise use **DELEGATE**. This is the default when Reasoning must interpret returned evidence or govern what follows, including substantial work, unresolved local choices, source inspection, research, exploration, diagnostics, tests, verification, and evidence gathering.
|
|
93
|
-
|
|
94
|
-
For Delegate, the normal loop is:
|
|
95
|
-
|
|
96
|
-
```text
|
|
97
|
-
Reasoning frames the question or settled direction
|
|
98
|
-
-> writes a decision-complete contract for one unit
|
|
99
|
-
-> switches to Standard
|
|
100
|
-
-> Standard executes and returns evidence
|
|
101
|
-
-> Reasoning interprets the evidence
|
|
102
|
-
-> more accepted work: delegate again
|
|
103
|
-
-> supported and complete: self-review, then CLOSE
|
|
104
|
-
-> contradiction or material change: diagnose, decide, ask, or return to Workflow
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
One environment call may still require Delegate. A large overall task may Yield one small, exact, ordinary bounded result. Better performance, convenience, fewer transitions, fewer tool calls, or preference for Reasoning never justifies direct access.
|
|
108
|
-
|
|
109
|
-
If uncertain, use `DELEGATE`.
|
|
110
|
-
|
|
111
|
-
A route never widens authority. If outcome, scope, authority, evidence boundary, or stop condition is unsettled, return to Workflow or [Decision Gate](../../skills/decision-gate/SKILL.md) before execution.
|
|
112
|
-
|
|
113
|
-
Examples:
|
|
114
|
-
|
|
115
|
-
- With boundary `NONE`, reading an exact package version and reporting it may Yield.
|
|
116
|
-
- With boundary `NONE`, reading a configuration file so Reasoning can choose an architecture requires Delegate.
|
|
117
|
-
- With boundary `OPEN`, even an exact package-version read remains Delegate and returns through the open boundary.
|
|
118
|
-
- A sensitive intervention whose next action depends on interpreting each prior effect may qualify for `ACT_BOUNDED`.
|
|
119
|
-
|
|
120
|
-
## Switching Profiles
|
|
121
|
-
|
|
122
|
-
Every automatic profile transition uses:
|
|
123
|
-
|
|
124
|
-
```text
|
|
125
|
-
freeflow_switch_profile(
|
|
126
|
-
target="reasoning" | "standard",
|
|
127
|
-
reason="one-sentence audit label"
|
|
128
|
-
)
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Write the applicable Yield brief, Delegate contract, handoff, or return before switching. The switch must be the only tool call in that assistant response. Shared context carries existing evidence; visible routing text carries only the meaning the receiving profile needs.
|
|
132
|
-
|
|
133
|
-
Do not switch after every tool call or during an atomic environment interaction when avoidable. Keep Standard active until its contract reaches a return condition.
|
|
134
|
-
|
|
135
|
-
## Reasoning Execution Boundaries
|
|
136
|
-
|
|
137
|
-
A **Reasoning execution boundary** is the visible protocol that keeps one material cognitive boundary coherent while Standard executes. Yield and `ACT_BOUNDED` do not create one. Reasoning owns the execution boundary; the current owner owns the bounded activity.
|
|
138
|
-
|
|
139
|
-
A Slice may contain zero, one, or many sequential boundaries. At most one boundary is `OPEN` at a time. Keep boundary state separate from its operation:
|
|
140
|
-
|
|
141
|
-
```text
|
|
142
|
-
Boundary state: NONE | OPEN
|
|
143
|
-
Boundary operation: NEW | REOPEN | CLOSE
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
- `NEW` opens the first delegated boundary for one bounded outcome.
|
|
147
|
-
- `REOPEN` is an authorized continuation of the same previously closed outcome, requiring fresh authority and either invalidating evidence or changed intent.
|
|
148
|
-
- `RETURN` is a transfer record that gives execution evidence back to Reasoning while leaving the boundary `OPEN`; it is not a boundary operation.
|
|
149
|
-
- `CLOSE` returns the boundary to `NONE`.
|
|
150
|
-
|
|
151
|
-
Opening, returning through, reopening, or closing a boundary never selects, extends, settles, or closes the wider Slice. A boundary cannot continue across distinct bounded activities.
|
|
152
|
-
|
|
153
|
-
## Standard’s Contract
|
|
154
|
-
|
|
155
|
-
During Yield or Delegate, Standard executes the current owner’s method under the applicable direction. It may reason about local mechanics, choose repository-consistent reversible details, use [Action Selection](../../skills/action-selection/SKILL.md), and apply appropriate methods such as [TDD](../../skills/tdd/SKILL.md) or [Simplify Code](../../skills/simplify-code/SKILL.md). It may gather required evidence, verify, and perform ordinary self-review through [Review Work](../../skills/review-work/SKILL.md).
|
|
156
|
-
|
|
157
|
-
Standard must return rather than settle or silently reinterpret a material change to outcome, architecture, policy, failure behavior, scope, authority, evidence boundary, or governing direction. It must return when:
|
|
158
|
-
|
|
159
|
-
- the contract’s result or required evidence is available;
|
|
160
|
-
- scoped execution or verification ends;
|
|
161
|
-
- the Yield result is no longer exact or local, or broad exploration or material Reasoning judgment becomes necessary;
|
|
162
|
-
- a blocker, material question, contradiction, or user-owned choice appears;
|
|
163
|
-
- execution, verification, or evidence fails or becomes inconclusive;
|
|
164
|
-
- scope, architecture, policy, failure behavior, authority, or evidence requirements materially change;
|
|
165
|
-
- the contract’s stop condition is reached;
|
|
166
|
-
- no covered action can advance the result;
|
|
167
|
-
- any fresh user message arrives, including interruption, cancellation, or direction change.
|
|
168
|
-
|
|
169
|
-
At a return condition, finish only the current atomic environment interaction, preserve partial effects and unverified work, write the active route’s transfer record, and switch to Reasoning. A fresh user message is never interpreted or answered by Automatic Standard.
|
|
170
|
-
|
|
171
|
-
## Yield To Standard
|
|
172
|
-
|
|
173
|
-
Yield is a one-off leadership transfer for one complete ordinary bounded result. Use it only while:
|
|
30
|
+
## Follow One Complete Loop
|
|
174
31
|
|
|
175
32
|
```text
|
|
176
|
-
|
|
33
|
+
Coordinator understands -> chooses a question or supported result -> assigns
|
|
34
|
+
Executor establishes the contract -> executes, checks, and locally corrects
|
|
35
|
+
-> prepares needed evidence -> selects and checks receipts when projection is on
|
|
36
|
+
-> submits the actual report and stops ordinary task work
|
|
37
|
+
Coordinator assesses the result and its direction -> continues, adapts, or closes
|
|
177
38
|
```
|
|
178
39
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
While Yield is active, Standard runs the ordinary unsplit Workflow for the yielded result and continues only while the original result and authority remain coherent. It hands back when the common return conditions apply, including when the result is supported and complete.
|
|
40
|
+
Reaching a result starts return preparation; it is not an instruction to submit before selecting evidence. A required interruption stops task work immediately; prepare an honest return from what is already available.
|
|
182
41
|
|
|
183
|
-
|
|
42
|
+
## Coordinator: Resolve The Next Planning Problem
|
|
184
43
|
|
|
185
|
-
|
|
186
|
-
YIELD HANDOFF
|
|
187
|
-
Result:
|
|
188
|
-
Evidence and limits:
|
|
189
|
-
Blocker, partial effects, or changed boundary, if any:
|
|
190
|
-
Handoff condition reached:
|
|
191
|
-
```
|
|
44
|
+
Before delegating, work out what should happen next, why, what must be established first, and what mistake the assignment should prevent. Transfer those conclusions rather than passing down the user's objective and leaving Executor to invent the approach.
|
|
192
45
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
A decision-complete contract is the smallest instruction that leaves Standard with no unresolved material judgment for its assigned unit. Use shared context rather than replaying it. Include only what applies:
|
|
200
|
-
|
|
201
|
-
- bounded outcome;
|
|
202
|
-
- supported judgment, constraints, and invariants;
|
|
203
|
-
- scope and necessary ordering;
|
|
204
|
-
- reversible local choices Standard may make;
|
|
205
|
-
- required evidence or verification;
|
|
206
|
-
- conditions that require return.
|
|
207
|
-
|
|
208
|
-
Reasoning may first delegate evidence gathering for a boundary it has not yet settled. Standard investigates the question and returns evidence; it does not settle the boundary.
|
|
209
|
-
|
|
210
|
-
### Open And Execute
|
|
211
|
-
|
|
212
|
-
For the first transfer, write:
|
|
213
|
-
|
|
214
|
-
```text
|
|
215
|
-
DELEGATE
|
|
216
|
-
Boundary operation: NEW | REOPEN
|
|
217
|
-
Boundary state: OPEN
|
|
218
|
-
```
|
|
46
|
+
| What is unsettled? | Next route |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| User intent or a user-owned choice | Discuss it; do not delegate a guess |
|
|
49
|
+
| Environmental facts or cause | Ask for evidence distinguishing plausible explanations |
|
|
50
|
+
| Implementation mechanism | Choose a bounded investigation or covered experiment before dependent work |
|
|
51
|
+
| Nothing material to the next result | Explain the supported design or correction and delegate execution |
|
|
219
52
|
|
|
220
|
-
|
|
53
|
+
One investigation may establish both facts and approach. A known local change needs no ceremonial discovery pass.
|
|
221
54
|
|
|
222
|
-
|
|
55
|
+
### Settle Consequential Implementation Decisions
|
|
223
56
|
|
|
224
|
-
|
|
57
|
+
Before substantial implementation, read [Design for Depth](../../skills/design-for-depth/SKILL.md) and use its Implementation Decisions method when unresolved representation, identity, ownership, algorithm, or failure choices could invalidate significant dependent work. Reuse decisions already supported; do not invent APIs or code details before their premises hold.
|
|
225
58
|
|
|
226
|
-
|
|
59
|
+
Carry the relevant decisions into the assignment: the selected mechanism, why it fits, its constraints, and what would invalidate it. Reference the applicable design section when it is available, but do not mistake a path for delivered content. A full patch for Executor to transcribe is not the goal. Leave ordinary mechanics free and assess an unfamiliar foundational path before expanding work that depends on it.
|
|
227
60
|
|
|
228
|
-
|
|
61
|
+
### Size Work Around Useful Judgment
|
|
229
62
|
|
|
230
|
-
|
|
231
|
-
RETURN
|
|
232
|
-
Boundary state: OPEN
|
|
63
|
+
Use uncertainty, branching, causal depth, and consequence to choose contract precision and assignment size—not file or tool count. Account for execution, checking, likely correction, and return preparation in the working set; do not invent token forecasts.
|
|
233
64
|
|
|
234
|
-
|
|
235
|
-
Evidence and verification:
|
|
236
|
-
Contradictions, limits, or residual effects:
|
|
237
|
-
Return condition reached:
|
|
238
|
-
```
|
|
65
|
+
Keep straightforward implementation and local correction together. Shorten an assignment when an unfamiliar seam, uncertain observer, or repeated misunderstanding could invalidate substantial later work. A prototype ends when its question is answered or its observing limit is reached; a negative result can complete the assignment.
|
|
239
66
|
|
|
240
|
-
|
|
67
|
+
Return at points where assessment can change what follows. Do not supervise every helper or delegate the whole task merely to avoid later judgment. Keep later work directional until its premises hold.
|
|
241
68
|
|
|
242
|
-
###
|
|
69
|
+
### Give A Usable Contract
|
|
243
70
|
|
|
244
|
-
|
|
71
|
+
Put the actual contract inside `freeflow_delegate(operation: "assign")`. Explain what matters:
|
|
245
72
|
|
|
246
|
-
|
|
73
|
+
- the question or result and its connection to the user's goal;
|
|
74
|
+
- established facts, hypotheses, and the supported approach;
|
|
75
|
+
- sources, relationships, ordering, invariants, and known traps;
|
|
76
|
+
- required constraints versus suggested mechanics, local freedom, and excluded effects;
|
|
77
|
+
- evidence needed for assessment and the condition requiring return.
|
|
247
78
|
|
|
248
|
-
|
|
79
|
+
Be more explicit where misunderstanding is likely or expensive without treating Executor as incapable. Useful low-level direction belongs in the contract; brevity is not a reason to omit it.
|
|
249
80
|
|
|
250
|
-
|
|
251
|
-
| --- | --- | --- |
|
|
252
|
-
| Supported and complete | Self-review, then close and report or continue through Workflow. | Close to `NONE`. |
|
|
253
|
-
| Supported with more accepted work | Delegate the next unit. | Remains `OPEN`. |
|
|
254
|
-
| One clear local defect | Delegate correction and affected verification through this boundary. | Remains `OPEN`. |
|
|
255
|
-
| Missing mechanical evidence | Delegate the smallest additional check. | Remains `OPEN`. |
|
|
256
|
-
| Unclear or repeated failure | Use [Diagnose Failure](../../skills/diagnose-failure/SKILL.md) or Workflow. | Open and suspended. |
|
|
257
|
-
| User-owned choice or source conflict | Use Decision Gate. | Open and suspended. |
|
|
258
|
-
| Changed intent, scope, authority, or source truth | Use Workflow. | Open and suspended until reconciled. |
|
|
259
|
-
| Distinct result or separately controlled work | Close or route the change through Workflow. | No silent continuation. |
|
|
81
|
+
Request evidence by purpose before its future refs exist: the actual diff, decisive assertion, observed output, or contrary finding. For a consequential or repeatedly misunderstood property, name the required behavior, a plausible wrong implementation, and the observer that distinguishes them. Leave ordinary instrumentation choices to Executor.
|
|
260
82
|
|
|
261
|
-
|
|
83
|
+
Use `replace` only for a supported, quiescent outstanding assignment whose unit outcome remains valid. State the reason, superseded direction, and what remains covered. Preserve prior effects and uncertainty. Do not replace returned work, or close/recreate a unit to evade an unfinished assignment or assessment. A changed or stopped unit outcome needs an honest disposition first.
|
|
262
84
|
|
|
263
|
-
|
|
85
|
+
## Executor: Execute Resourcefully
|
|
264
86
|
|
|
265
|
-
|
|
87
|
+
Establish the exact contract, constraints, and return condition. Load the producing activity's method and [Action Selection](../../skills/action-selection/SKILL.md) when absent; reuse retained methods. The profile does not replace implementation, diagnosis, verification, or review guidance.
|
|
266
88
|
|
|
267
|
-
|
|
268
|
-
CLOSE
|
|
269
|
-
Boundary state: NONE
|
|
270
|
-
Current owner: unchanged
|
|
271
|
-
|
|
272
|
-
Supported bounded result:
|
|
273
|
-
Important evidence, assumptions, and limits:
|
|
274
|
-
Next route:
|
|
275
|
-
REOPEN only if:
|
|
276
|
-
```
|
|
89
|
+
Follow required direction and ordering. Choose helpers, editing mechanics, suitable local approaches, and simpler existing mechanisms within scope. Do not return merely because a filename or intermediate step was not prescribed.
|
|
277
90
|
|
|
278
|
-
|
|
91
|
+
Challenge unsupported premises and report better approaches. Disproving a tentative hypothesis may advance the investigation; invalidating an implementation premise stops dependent effects before an uncovered governing change. Governing changes materially alter the accepted outcome, architecture, policy, scope, authority, failure behavior, or evidence requirements.
|
|
279
92
|
|
|
280
|
-
|
|
93
|
+
Correct expected regressions and understood mechanical errors locally. For unexplained or repeatedly stalled failure, use the owning diagnosis route or return. Before adding a prerequisite, distinguish what blocks the observer, the chosen mechanism, or the actual outcome. Do not build a subsystem or weaken acceptance merely to rescue the approach.
|
|
281
94
|
|
|
282
|
-
|
|
95
|
+
Use [Verify Work](../../skills/verify-work/SKILL.md) before claiming the result. Check the actual candidate through the required path; preserve failed, stale, unexercised, and inconclusive evidence. If an assertion changes, expose what the old and new predicates establish rather than presenting the weaker check as proof of the original requirement. Use its Test Design method when observer sensitivity is uncertain.
|
|
283
96
|
|
|
284
|
-
|
|
97
|
+
Once evidence supports the result, silently self-review through the producing method and correct covered defects. This does not accept the unit or authorize follow-up work.
|
|
285
98
|
|
|
286
|
-
|
|
99
|
+
Begin return preparation when the result is available, a stop condition is reached, a governing decision is needed, no useful covered action remains, or fresh user input requires Coordinator attention.
|
|
287
100
|
|
|
288
|
-
|
|
289
|
-
2. shared-context delegation would cause material loss beyond premium execution cost.
|
|
290
|
-
|
|
291
|
-
Before acting, write:
|
|
292
|
-
|
|
293
|
-
```text
|
|
294
|
-
ACT_BOUNDED
|
|
295
|
-
Scope and expected result:
|
|
296
|
-
Why judgment and action are inseparable:
|
|
297
|
-
Why delegation would materially lose:
|
|
298
|
-
Existing authority:
|
|
299
|
-
Stop and reassess when:
|
|
300
|
-
```
|
|
101
|
+
## Executor: Prepare Evidence, Then Return
|
|
301
102
|
|
|
302
|
-
|
|
103
|
+
Executor sees ordinary Pi active context. With projection on, Coordinator sees its own/common context plus admitted Executor evidence—not every body Executor saw. A report, ref, filename, or call envelope is not the underlying result.
|
|
303
104
|
|
|
304
|
-
|
|
105
|
+
1. **Reconcile claims and evidence.** Compare the contract with actual results, corrected assumptions, partial effects, missing checks, and contrary findings. Ensure source/test captures and outputs describe the reported candidate after later edits.
|
|
106
|
+
2. **Select what assessment needs.** When projection is on, project every completed skill and instructional-reference read, including the bootstrap read. Add the other missing eligible bodies needed to assess the result. Prefer actual tool results for execution claims and substantive assistant text when that text is the object of judgment.
|
|
107
|
+
3. **Read receipts and correct supported problems.** Preserve valid selections. Resolve bad identities or representations where supported; withdraw unavailable or unnecessary requests only with a reason and retain their material limitations. Removing a ref does not resolve a required evidence gap. Do not silently substitute a summary for a promised original or hide adverse evidence to obtain readiness.
|
|
108
|
+
4. **Submit the actual report.** State the result, evidence and limits, corrected assumptions, partial effects, and reason for return in `freeflow_return(operation: "submit")`. Then stop ordinary assignment work.
|
|
305
109
|
|
|
306
|
-
|
|
110
|
+
Use known refs directly. Use bounded `freeflow_project inspect` only when a needed identity or selection state is unclear; it discovers metadata, not full source bodies or an exhaustive tool log. Let the harness resolve native dependencies and eligible historical sources. Do not guess refs, reread merely to manufacture them, or inspect after every tool call.
|
|
307
111
|
|
|
308
|
-
|
|
112
|
+
Select incrementally when useful, then reconcile the final set before submission. Requested evidence is a minimum, not an exclusive allowlist. Do not dump every source or copy raw outputs into the report to evade projection. Select the smallest sufficient set, including governing background and contradictions needed for assessment.
|
|
309
113
|
|
|
310
|
-
|
|
114
|
+
No additional discretionary selection is needed when Coordinator already has the evidence, the result is self-contained, or an interrupted/blocked return honestly lacks it. Absence of an explicit request to project does not excuse missing support. With projection off, skip projection tools, not verification or honest reporting.
|
|
311
115
|
|
|
312
|
-
|
|
116
|
+
Optional Context Control cleanup may occur after promised evidence is prepared. Account for new reads or changed evidence before submitting. Batch already-decided selection changes and one return last only when the report does not depend on an unread receipt. Never combine new task work with a report that assumes its unseen outcome.
|
|
313
117
|
|
|
314
|
-
|
|
118
|
+
### Preserve A Blocked Or Interrupted Return
|
|
315
119
|
|
|
316
|
-
|
|
120
|
+
Do not delay cancellation or a required stop to run another read, test, or retrieval. Preserve available evidence through permitted handoff preparation. If evidence remains unavailable or selection is blocked, save a partial or blocked report with explicit gaps; do not force an unsupported `completed` outcome.
|
|
317
121
|
|
|
318
|
-
|
|
122
|
+
`reportSaved` is not configured, delivered, or assessed. If transfer is blocked, ordinary task work remains ended. Correct only the supported handoff problem, then use payload-free `freeflow_return(operation: "retry")` for the unchanged saved report. Use `submit` only for a deliberate report revision. Do not redo the investigation or repeat uncertain effects; reconcile them through supported controls.
|
|
319
123
|
|
|
320
|
-
|
|
124
|
+
## Coordinator: Assess The Result And Your Direction
|
|
321
125
|
|
|
322
|
-
|
|
126
|
+
Assess the report and evidence already received. Ordinary assessment requires neither `inspect` nor `assess`. The `assess` operation restores a suspended assessment's evidence obligation; it does not perform judgment or accept the result.
|
|
323
127
|
|
|
324
|
-
|
|
128
|
+
For a material claim, compare the accepted property, actual observer, decisive assertions, candidate identity, and result. A confident report or green suite cannot supply a missing link. Keep unsupported required claims open and stop dependent work.
|
|
325
129
|
|
|
326
|
-
|
|
130
|
+
Also ask whether your direction served the user's outcome: did it leave a consequential decision implicit, impose an unnecessary mechanism, choose the wrong observer, or size the assignment poorly? Accept a simpler valid implementation without demanding your preferred style. For a consequential design choice, assess its actual realization, not merely a claim that the spec was followed.
|
|
327
131
|
|
|
328
|
-
|
|
132
|
+
Reuse adequate verification and Executor self-review. Use [Review Work](../../skills/review-work/SKILL.md) or [Review Artifact](../../skills/review-artifact/SKILL.md) when their judgment method is needed; load it when absent. A separate independent review remains a Workflow decision, not an automatic handoff step.
|
|
329
133
|
|
|
330
|
-
|
|
331
|
-
- failed Delegate switch to Standard: the boundary remains `OPEN`; Standard does not begin;
|
|
332
|
-
- failed `YIELD HANDOFF` switch to Reasoning: Standard stops after the safe handoff point;
|
|
333
|
-
- failed `RETURN` switch to Reasoning: Standard stops and cannot resolve or close the open boundary;
|
|
334
|
-
- failed switch from Manual to Automatic: remain under the held manual profile.
|
|
134
|
+
Choose the next action from the actual gap:
|
|
335
135
|
|
|
336
|
-
|
|
136
|
+
- **Supported result, covered work remains:** assign the next coherent result.
|
|
137
|
+
- **Existing evidence omitted:** seek supported selection/delivery correction before new investigation.
|
|
138
|
+
- **Missing or inadequate observation:** request the discriminating evidence, preserving the required property.
|
|
139
|
+
- **Supported defect:** explain the correction and affected checks.
|
|
140
|
+
- **Invalidated approach or unclear cause:** revise the affected direction or investigate; do not repeat the same demand more forcefully.
|
|
141
|
+
- **User-owned choice:** discuss through Workflow or Decision Gate before dependent work.
|
|
142
|
+
- **Outcome complete or deliberately stopped:** close with an honest disposition.
|
|
337
143
|
|
|
338
|
-
|
|
144
|
+
Carry supported lessons into later contracts. Add precision where misunderstanding occurred; keep freedom where execution was sound. Repeated failure needs a changed premise, observer, contract, working set, or mechanism—not lower acceptance or an endless repair loop. Changing user-controlled compute configuration remains a separate decision.
|
|
339
145
|
|
|
340
|
-
|
|
146
|
+
Use `freeflow_unit(close)` as Coordinator only when the required result and evidence are supported and applicable checkpoints and contradictions are resolved, or record an authorized cancelled/deferred outcome without claiming completion. Closing a unit does not complete a Working Record task, delete relevant history, or authorize delivery, commit, release, or deployment. Continue covered work to the user's agreed boundary, not merely to an internal handoff.
|
|
341
147
|
|
|
342
|
-
|
|
343
|
-
- current owner and bounded activity;
|
|
344
|
-
- active Yield or Delegate route;
|
|
345
|
-
- model-written boundary operation and state, when one exists;
|
|
346
|
-
- latest contract, handoff, or return;
|
|
347
|
-
- live authority, evidence, partial effects, unverified work, and stop condition.
|
|
148
|
+
## Handle Input, Context, And Recovery
|
|
348
149
|
|
|
349
|
-
|
|
150
|
+
Under Automatic control, Coordinator owns substantive user interpretation, discussion, decisions, and reporting. New natural-language input, including "continue," goes through Coordinator. If it reaches an already prepared Executor request, honor restrictions immediately, stop task work, and return the available partial state. Runtime State refreshes do not trigger this interruption rule.
|
|
350
151
|
|
|
351
|
-
|
|
152
|
+
Native tool responses and technical retries continue within the assignment. `/freeflow resume` is an explicit user control for eligible interrupted work after reconciliation, not permission to release a manual hold or resume ordinary work after a saved return. Releasing Manual control returns responsibility for reconciliation to Coordinator.
|
|
352
153
|
|
|
353
|
-
|
|
354
|
-
- Yield merely because no boundary is visible;
|
|
355
|
-
- completion from a profile change;
|
|
356
|
-
- authority from a prior contract;
|
|
357
|
-
- live state from task memory.
|
|
154
|
+
After context loss or uncertain continuity, recover control, current responsibility, applicable contract/report, user direction, partial effects, evidence limits, and stop conditions. Reload missing methods. When a Working Record exists, follow [Track Work](../../skills/track-work/SKILL.md) for complete `full` recovery and current-source reconciliation; record and evidence reads remain Executor work. Do not combine a superseded stopping instruction with a newer contract.
|
|
358
155
|
|
|
359
|
-
|
|
156
|
+
Attach recovery to the existing responsibility. Outstanding assignments recover through their supported continuation. Returned work may use an attached recovery-only phase only if the runtime actually exposes it; otherwise inspect saved communication and stop if insufficient. Do not simulate recovery by replacing the assignment or report. A separate recovery assignment is appropriate only when no existing assignment or assessment needs preservation.
|
|
360
157
|
|
|
361
|
-
|
|
158
|
+
Use `freeflow_unit(assess)` when a suspended assessment becomes the intended activity again. Failed restoration leaves the gap open. Suspension pauses additional evidence restoration, not the relevance of ordinary admitted history. Navigation does not roll back files, processes, or task memory; historical instructions do not grant current authority.
|
|
362
159
|
|
|
363
|
-
|
|
160
|
+
When Context Control is effective, read its method before managing your own view. Either profile may reduce obsolete or redundant material without losing current direction, contrary findings, or promised evidence. Cleanup is optional and never changes the other profile's view, canonical history, or evidence membership. Prepare promised originals first; if cleanup fails, retain the extra context and continue the valid handoff. Do not discard useful communication merely because a unit closed.
|
|
364
161
|
|
|
365
|
-
|
|
162
|
+
## ACT_BOUNDED: Inseparable Judgment And Action
|
|
366
163
|
|
|
367
|
-
-
|
|
368
|
-
- Reasoning closes a Delegate boundary;
|
|
369
|
-
- an `ACT_BOUNDED` scope reaches its stop condition;
|
|
370
|
-
- no execution-bearing bounded activity is authorized;
|
|
371
|
-
- Workflow reaches a Supported Exit.
|
|
164
|
+
Beyond permitted routing, instructional reads, and view-local context operations, direct Coordinator environment work requires both inseparable judgment/action and a concrete material loss from delegation. Task size, convenience, fewer switches, preference for the stronger model, or failed recovery is insufficient.
|
|
372
165
|
|
|
373
|
-
|
|
166
|
+
Synthesis may qualify when the requested artifact is the governing judgment itself and a decision-complete contract would already contain essentially the artifact. Sensitive result-by-result intervention may also qualify. Separable gathering, routine checking, and ordinary implementation remain delegated.
|
|
374
167
|
|
|
375
|
-
|
|
168
|
+
Before acting, state ACT_BOUNDED with the scope, expected result, existing authority, stop condition, inseparable judgment, and delegation loss. Stay within it; end on completion, interruption, context loss, changed applicability, or before delegating again. It grants no permission and does not create, transfer, or close routing responsibility.
|
|
376
169
|
|
|
377
|
-
|
|
378
|
-
- let Automatic Standard begin execution without an active contract or conduct substantive user-facing interaction outside transfer control text;
|
|
379
|
-
- let Standard settle unresolved material judgment or decide whether Reasoning is needed;
|
|
380
|
-
- turn a profile into a new owner or treat profile capability as authority;
|
|
381
|
-
- treat Yield as an open boundary or `RETURN` as boundary closure;
|
|
382
|
-
- create a boundary per tool call, correction, or self-review;
|
|
383
|
-
- keep a boundary across distinct bounded activities;
|
|
384
|
-
- close an unsupported boundary to avoid resolving it;
|
|
385
|
-
- use `ACT_BOUNDED` for ordinary work, convenience, or transition avoidance;
|
|
386
|
-
- continue an unclear or repeated correction loop;
|
|
387
|
-
- hide transfer meaning in private reasoning.
|
|
170
|
+
Stop applying the automatic split when control becomes Manual or routing becomes inactive. Preserve unfinished responsibility honestly and follow ordinary Workflow.
|
package/command-surface.json
CHANGED
|
@@ -86,7 +86,13 @@
|
|
|
86
86
|
"kind": "settings"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
"command": "/freeflow profile <
|
|
89
|
+
"command": "/freeflow profile <coordinator|executor|auto>",
|
|
90
|
+
"handler": "freeflow",
|
|
91
|
+
"kind": "cognitive-routing-control",
|
|
92
|
+
"piOnly": true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"command": "/freeflow resume",
|
|
90
96
|
"handler": "freeflow",
|
|
91
97
|
"kind": "cognitive-routing-control",
|
|
92
98
|
"piOnly": true
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isMainModule, runSafely, runSessionStartAdapter } from "../shared/runtime-context.mjs";
|
|
2
|
+
|
|
3
|
+
export function main() {
|
|
4
|
+
runSessionStartAdapter({
|
|
5
|
+
eventNames: ["SessionStart"],
|
|
6
|
+
getWorkspaceCwd: (input) => input.cwd || process.cwd(),
|
|
7
|
+
formatOutput: ({ eventName, additionalContext }) => ({
|
|
8
|
+
hookSpecificOutput: {
|
|
9
|
+
hookEventName: eventName,
|
|
10
|
+
additionalContext,
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (isMainModule(import.meta.url)) runSafely(main);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isMainModule, runSafely, runSessionStartAdapter } from "../shared/runtime-context.mjs";
|
|
2
|
+
|
|
3
|
+
export function main() {
|
|
4
|
+
runSessionStartAdapter({
|
|
5
|
+
eventNames: ["SessionStart"],
|
|
6
|
+
getWorkspaceCwd: (input) => input.cwd || process.cwd(),
|
|
7
|
+
formatOutput: ({ eventName, additionalContext }) => ({
|
|
8
|
+
hookSpecificOutput: {
|
|
9
|
+
hookEventName: eventName,
|
|
10
|
+
additionalContext,
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (isMainModule(import.meta.url)) runSafely(main);
|