fito-tui 0.2.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/README.md +88 -0
- package/agents/fito-case-source-planner.md +265 -0
- package/agents/fito-performance-reviewer.md +231 -0
- package/agents/fito-practice-concept-content-generator.md +318 -0
- package/agents/fito-practice-concept-identifier.md +482 -0
- package/agents/fito-practice-execution-fact-content-generator.md +299 -0
- package/agents/fito-practice-execution-fact-identifier.md +367 -0
- package/agents/fito-practice-usage-scenario-content-generator.md +331 -0
- package/agents/fito-practice-usage-scenario-identifier.md +397 -0
- package/agents/fito-subagent-selftest.md +27 -0
- package/agents/fito-technology-generator.md +207 -0
- package/agents/fito-tool-concept-content-generator.md +282 -0
- package/agents/fito-tool-concept-identifier.md +384 -0
- package/agents/fito-tool-execution-fact-content-generator.md +382 -0
- package/agents/fito-tool-execution-fact-identifier.md +360 -0
- package/agents/fito-tool-usage-scenario-content-generator.md +381 -0
- package/agents/fito-tool-usage-scenario-identifier.md +432 -0
- package/agents/fito-tutor.md +185 -0
- package/extensions/fito-delegate.js +539 -0
- package/extensions/fito-delegate.ts +691 -0
- package/extensions/fito-fetch-tools.js +380 -0
- package/extensions/fito-fetch-tools.ts +419 -0
- package/extensions/fito-startup.js +166 -0
- package/extensions/fito-startup.ts +188 -0
- package/package.json +56 -0
- package/prompts/fito-auth-refresh.md +15 -0
- package/prompts/fito-case-design.md +506 -0
- package/prompts/fito-case-edit.md +91 -0
- package/prompts/fito-case-generate.md +222 -0
- package/prompts/fito-case-open.md +124 -0
- package/prompts/fito-case-plan-source.md +114 -0
- package/prompts/fito-create-or-update-competence.md +261 -0
- package/prompts/fito-create-or-update-technology.md +199 -0
- package/prompts/fito-delete-competence.md +147 -0
- package/prompts/fito-evaluate.md +148 -0
- package/prompts/fito-fetch-urls-content.md +35 -0
- package/prompts/fito-generate-domain-concepts.md +85 -0
- package/prompts/fito-generate-execution-facts.md +85 -0
- package/prompts/fito-generate-usage-scenarios.md +85 -0
- package/prompts/fito-identify-domain-concepts.md +49 -0
- package/prompts/fito-identify-execution-facts.md +49 -0
- package/prompts/fito-identify-usage-scenarios.md +49 -0
- package/prompts/fito-login.md +21 -0
- package/prompts/fito-logout.md +14 -0
- package/prompts/fito-publish-case.md +266 -0
- package/prompts/fito-push-knowledge.md +84 -0
- package/prompts/fito-submit.md +208 -0
- package/prompts/fito-tutor.md +120 -0
- package/shared/case-briefing/briefing.js +221 -0
- package/shared/case-briefing/briefing.ts +261 -0
- package/shared/case-quiz/scoring.js +16 -0
- package/shared/case-quiz/scoring.ts +61 -0
- package/shared/case-validation/case-loader.js +88 -0
- package/shared/case-validation/case-loader.ts +106 -0
- package/shared/case-validation/case-schema.js +716 -0
- package/shared/case-validation/case-schema.ts +895 -0
- package/shared/competences/competence-list.js +29 -0
- package/shared/competences/competence-list.ts +32 -0
- package/shared/fito-api/README.md +192 -0
- package/shared/fito-api/client.js +731 -0
- package/shared/fito-api/client.ts +1426 -0
- package/shared/fito-session/credentials.js +79 -0
- package/shared/fito-session/credentials.ts +88 -0
- package/shared/fito-session/session.js +16 -0
- package/shared/fito-session/session.ts +35 -0
- package/shared/github-url/parse.js +26 -0
- package/shared/github-url/parse.ts +35 -0
- package/shared/knowledge-components/component-names.js +35 -0
- package/shared/knowledge-components/component-names.ts +39 -0
- package/shared/knowledge-components/knowledge-fetch.js +46 -0
- package/shared/knowledge-components/knowledge-fetch.ts +57 -0
- package/shared/knowledge-components/knowledge-search.js +101 -0
- package/shared/knowledge-components/knowledge-search.ts +144 -0
- package/shared/knowledge-components/push-payload.js +104 -0
- package/shared/knowledge-components/push-payload.ts +129 -0
- package/shared/knowledge-components/reference.js +24 -0
- package/shared/knowledge-components/reference.ts +43 -0
- package/shared/knowledge-components/technology-fetch.js +30 -0
- package/shared/knowledge-components/technology-fetch.ts +38 -0
- package/shared/shell-exec/exec.js +22 -0
- package/shared/shell-exec/exec.ts +46 -0
- package/skills/fito-auth/SKILL.md +68 -0
- package/skills/fito-auth/auth-refresh.js +23 -0
- package/skills/fito-auth/auth-refresh.ts +25 -0
- package/skills/fito-auth/browser.js +35 -0
- package/skills/fito-auth/browser.ts +57 -0
- package/skills/fito-auth/callback-server.js +152 -0
- package/skills/fito-auth/callback-server.ts +189 -0
- package/skills/fito-auth/login.js +37 -0
- package/skills/fito-auth/login.ts +42 -0
- package/skills/fito-auth/logout.js +24 -0
- package/skills/fito-auth/logout.ts +25 -0
- package/skills/fito-case-author/SKILL.md +179 -0
- package/skills/fito-case-author/checkout.js +222 -0
- package/skills/fito-case-author/checkout.ts +281 -0
- package/skills/fito-case-author/github-publish.js +218 -0
- package/skills/fito-case-author/github-publish.ts +251 -0
- package/skills/fito-case-author/publish-payload.js +108 -0
- package/skills/fito-case-author/publish-payload.ts +186 -0
- package/skills/fito-case-author/publish-state.js +72 -0
- package/skills/fito-case-author/publish-state.ts +87 -0
- package/skills/fito-case-author/publish-version.js +364 -0
- package/skills/fito-case-author/publish-version.ts +495 -0
- package/skills/fito-case-author/publish.js +284 -0
- package/skills/fito-case-author/publish.ts +394 -0
- package/skills/fito-case-author/semver.js +55 -0
- package/skills/fito-case-author/semver.ts +63 -0
- package/skills/fito-case-author/status-gate.js +34 -0
- package/skills/fito-case-author/status-gate.ts +54 -0
- package/skills/fito-case-author/validate.js +62 -0
- package/skills/fito-case-author/validate.ts +64 -0
- package/skills/fito-case-runner/SKILL.md +119 -0
- package/skills/fito-case-runner/case-component-names.js +45 -0
- package/skills/fito-case-runner/case-component-names.ts +65 -0
- package/skills/fito-case-runner/case-detail.js +20 -0
- package/skills/fito-case-runner/case-detail.ts +20 -0
- package/skills/fito-case-runner/github.js +234 -0
- package/skills/fito-case-runner/github.ts +287 -0
- package/skills/fito-case-runner/manifest.js +56 -0
- package/skills/fito-case-runner/manifest.ts +73 -0
- package/skills/fito-case-runner/open.js +175 -0
- package/skills/fito-case-runner/open.ts +241 -0
- package/skills/fito-case-runner/report.js +22 -0
- package/skills/fito-case-runner/report.ts +24 -0
- package/skills/fito-case-runner/runner.js +158 -0
- package/skills/fito-case-runner/runner.ts +304 -0
- package/skills/fito-case-runner/score-quiz-mc.js +85 -0
- package/skills/fito-case-runner/score-quiz-mc.ts +99 -0
- package/skills/fito-case-runner/submit-evaluation.js +73 -0
- package/skills/fito-case-runner/submit-evaluation.ts +98 -0
- package/skills/fito-case-runner/submit-quiz-result.js +75 -0
- package/skills/fito-case-runner/submit-quiz-result.ts +100 -0
- package/skills/fito-case-runner/submit.js +85 -0
- package/skills/fito-case-runner/submit.ts +111 -0
- package/skills/fito-case-runner/workdir.js +10 -0
- package/skills/fito-case-runner/workdir.ts +11 -0
- package/skills/fito-competence-write/SKILL.md +155 -0
- package/skills/fito-competence-write/create.js +64 -0
- package/skills/fito-competence-write/create.ts +80 -0
- package/skills/fito-competence-write/delete.js +136 -0
- package/skills/fito-competence-write/delete.ts +166 -0
- package/skills/fito-competence-write/display.js +20 -0
- package/skills/fito-competence-write/display.ts +21 -0
- package/skills/fito-competence-write/payload.js +96 -0
- package/skills/fito-competence-write/payload.ts +115 -0
- package/skills/fito-competence-write/update.js +155 -0
- package/skills/fito-competence-write/update.ts +206 -0
- package/skills/fito-evaluator/SKILL.md +73 -0
- package/skills/fito-evaluator/criterion-exec.js +64 -0
- package/skills/fito-evaluator/criterion-exec.ts +73 -0
- package/skills/fito-evaluator/evaluate-automated.js +57 -0
- package/skills/fito-evaluator/evaluate-automated.ts +84 -0
- package/skills/fito-evaluator/evaluate.js +28 -0
- package/skills/fito-evaluator/evaluate.ts +86 -0
- package/skills/fito-evaluator/report.js +112 -0
- package/skills/fito-evaluator/report.ts +128 -0
- package/skills/fito-evaluator/rubric.js +90 -0
- package/skills/fito-evaluator/rubric.ts +170 -0
- package/skills/fito-knowledge-push/SKILL.md +114 -0
- package/skills/fito-knowledge-push/push.js +282 -0
- package/skills/fito-knowledge-push/push.ts +360 -0
- package/skills/fito-source-ingestion/SKILL.md +77 -0
- package/skills/fito-source-ingestion/authoring-check.js +128 -0
- package/skills/fito-source-ingestion/authoring-check.ts +155 -0
- package/skills/fito-source-ingestion/bundle.js +198 -0
- package/skills/fito-source-ingestion/bundle.ts +246 -0
- package/skills/fito-technology-write/SKILL.md +108 -0
- package/skills/fito-technology-write/create.js +134 -0
- package/skills/fito-technology-write/create.ts +161 -0
- package/skills/fito-technology-write/payload.js +64 -0
- package/skills/fito-technology-write/payload.ts +70 -0
- package/skills/fito-technology-write/update.js +122 -0
- package/skills/fito-technology-write/update.ts +171 -0
- package/skills/fito-url-content-fetcher/SKILL.md +213 -0
- package/templates/concept-practice-content-template.md +281 -0
- package/templates/concept-tool-content-template.md +207 -0
- package/templates/execution-fact-practice-content-template.md +372 -0
- package/templates/execution-fact-tool-content-template.md +307 -0
- package/templates/usage-scenario-content-template.md +248 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
ExtensionAPI,
|
|
6
|
+
ExtensionContext,
|
|
7
|
+
SourceInfo,
|
|
8
|
+
} from "@earendil-works/pi-coding-agent";
|
|
9
|
+
|
|
10
|
+
import { FitoApiError, createFitoApiClient } from "../shared/fito-api/client.ts";
|
|
11
|
+
import { registerFitoDelegateTool } from "./fito-delegate.ts";
|
|
12
|
+
import {
|
|
13
|
+
registerFitoCasePartialFetchTool,
|
|
14
|
+
registerFitoCompetenceListTool,
|
|
15
|
+
registerFitoKnowledgeFetchTool,
|
|
16
|
+
registerFitoKnowledgeSearchTool,
|
|
17
|
+
registerFitoTechnologyFetchTool,
|
|
18
|
+
} from "./fito-fetch-tools.ts";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Fito startup extension.
|
|
22
|
+
*
|
|
23
|
+
* **The persona sync is gone.** Until 2026-09-17 this extension copied the
|
|
24
|
+
* package's `agents/*.md` into the session's `.pi/agents/` at every
|
|
25
|
+
* `session_start`, because ADR-002 Decision 3 had verified that `pi-subagents`
|
|
26
|
+
* read personas only from hardcoded roots. That premise expired: `pi-subagents`
|
|
27
|
+
* now discovers a package's own agent directories from its manifest
|
|
28
|
+
* (`{"pi-subagents":{"agents":["agents"]}}`, its `docs/agents.md`), so
|
|
29
|
+
* `tui/package.json` declares `agents/` and the personas are read **in place**.
|
|
30
|
+
* Nothing is copied, so nothing can be copied to the wrong place — the old walk
|
|
31
|
+
* accepted the learner's `~/.pi/` as a project root and, from any directory
|
|
32
|
+
* without a marker of its own, wrote seventeen personas into their home that no
|
|
33
|
+
* reader ever looked at. See ADR-002's 2026-09-17 revision.
|
|
34
|
+
*
|
|
35
|
+
* What remains here is the `session_start` checks — the guard for the missing
|
|
36
|
+
* `subagent` tool, the `pi-subagents` version floor, and the backend's refusal of this
|
|
37
|
+
* TUI's version (both Task 15d.7b) — and registration of Fito-owned custom tools (`pi.registerTool(...)`)
|
|
38
|
+
* for the **main**
|
|
39
|
+
* session: `fito_knowledge_fetch` (Task 5.1b), the in-process knowledge-component
|
|
40
|
+
* read that the `fito-tutor` worker holds while denied bash/filesystem (Success
|
|
41
|
+
* Criterion #9; ADR-006), `fito_technology_fetch` (Task 9a.6a), the
|
|
42
|
+
* technology-version read that grounds the design / plan-source toolchain
|
|
43
|
+
* cross-check (ADR-011 §9), `fito_knowledge_search` (Task 9c.11), the
|
|
44
|
+
* component listing `/fito-case-design` selects from instead of guessing ids —
|
|
45
|
+
* a flow that runs **here**, in the main session, which is why the tool has to be
|
|
46
|
+
* registered at this call site and not only in the child registrar —
|
|
47
|
+
* `fito_competence_list` (Task 15b.6), a technology's competences, registered here for the
|
|
48
|
+
* same reason: the competence-authoring flow that reads it runs in the main session — and
|
|
49
|
+
* `fito_case_partial_fetch` (Task 11.2), the allow-listed read of a locally opened
|
|
50
|
+
* case that the `fito-tutor` worker holds in place of filesystem access. The registrars
|
|
51
|
+
* live in `./fito-fetch-tools.ts` so the
|
|
52
|
+
* same tools can be loaded into a subagent **child** via a persona's
|
|
53
|
+
* `subagentOnlyExtensions` (Task 9a.10) — a bare allowlist name alone does not
|
|
54
|
+
* register the tool in the child's separate pi process.
|
|
55
|
+
*
|
|
56
|
+
* **Registration is main-session-only** (Task 9b.11, fix F28). A `pi-subagents` child
|
|
57
|
+
* loads *both* registrars: this extension still arrives through package auto-discovery
|
|
58
|
+
* — `pi-subagents` passes `--no-extensions` only when a persona declares `extensions:`,
|
|
59
|
+
* and ours declare only `subagentOnlyExtensions` — while the persona additionally loads
|
|
60
|
+
* `./fito-fetch-tools.ts` explicitly. Two extensions owning one tool name is what pi's
|
|
61
|
+
* post-load `detectExtensionConflicts` reports, and in the headless child that diagnostic
|
|
62
|
+
* is **fatal**: every fetch-tool persona died at spawn ("Failed to load extension …").
|
|
63
|
+
* So the child takes every fetch tool from `./fito-fetch-tools.ts` alone, and this extension
|
|
64
|
+
* stands down — detected via `PI_SUBAGENT_CHILD`, which `pi-subagents` sets to `"1"` for
|
|
65
|
+
* every child it spawns and compares the same way in its own extension.
|
|
66
|
+
*
|
|
67
|
+
* That leaves the persona as the child's *only* source for these tools, so the other half
|
|
68
|
+
* of the contract is enforced in `../agents/knowledge-pipeline-artifacts.test.ts`: every
|
|
69
|
+
* persona whose `tools:` names a `fito_*` tool must declare `subagentOnlyExtensions`, or
|
|
70
|
+
* its child allow-lists a tool that nothing registers.
|
|
71
|
+
*
|
|
72
|
+
* The same guard also scopes `fito_delegate` (Task 11.8, `./fito-delegate.ts`) to the main session —
|
|
73
|
+
* for a third reason, neither F28's nor the marker's: delegation is what a session does *to* a
|
|
74
|
+
* child, so registering it in a child would hand a worker the means to delegate onward. It carries
|
|
75
|
+
* `pi-subagents`' launch parameters in TypeScript so no Fito prompt has to name them in prose
|
|
76
|
+
* (lesson 82), and it registers here rather than in `./fito-fetch-tools.ts` precisely because that
|
|
77
|
+
* module is the *child's* registrar.
|
|
78
|
+
*
|
|
79
|
+
* **The run-id marker that used to register here is gone** (Task 11.4a, retired at 11.8b). It
|
|
80
|
+
* appended a Fito-worded run id to every `subagent` tool result, because `/fito-tutor` had to read
|
|
81
|
+
* that id out of prose to resume its thread. `fito_delegate` now runs the tutor's thread and holds
|
|
82
|
+
* the id itself, so there is no vendor tool result left to annotate and no reader for the line.
|
|
83
|
+
*/
|
|
84
|
+
export default function registerFitoStartup(pi: ExtensionAPI): void {
|
|
85
|
+
if (process.env.PI_SUBAGENT_CHILD !== "1") {
|
|
86
|
+
registerFitoKnowledgeFetchTool(pi);
|
|
87
|
+
registerFitoKnowledgeSearchTool(pi);
|
|
88
|
+
registerFitoTechnologyFetchTool(pi);
|
|
89
|
+
registerFitoCompetenceListTool(pi);
|
|
90
|
+
registerFitoCasePartialFetchTool(pi);
|
|
91
|
+
registerFitoDelegateTool(pi);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
pi.on("session_start", (_event, ctx: ExtensionContext) => {
|
|
95
|
+
if (!ctx.hasUI) return;
|
|
96
|
+
|
|
97
|
+
// Say so when the delegation transport is absent. Eleven Fito commands reach a worker
|
|
98
|
+
// persona through `pi-subagents`, so without it they fail one by one at the point of use;
|
|
99
|
+
// this turns that into a single message naming the install command (ADR-002 Decision 2 —
|
|
100
|
+
// Fito requires it as a separate install and does not bundle it).
|
|
101
|
+
const subagent = pi.getAllTools().find((tool) => tool.name === "subagent");
|
|
102
|
+
if (subagent === undefined) {
|
|
103
|
+
ctx.ui.notify(
|
|
104
|
+
"Fito requires the 'subagent' tool, which is not installed. " +
|
|
105
|
+
"Install it with: pi install npm:pi-subagents",
|
|
106
|
+
"error",
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (process.env.PI_SUBAGENT_CHILD === "1") return;
|
|
111
|
+
|
|
112
|
+
if (subagent !== undefined && isBelowPiSubagentsFloor(subagent.sourceInfo)) {
|
|
113
|
+
ctx.ui.notify(
|
|
114
|
+
`Fito needs pi-subagents ${PI_SUBAGENTS_FLOOR.join(".")} or newer. Run: \`pi update --extensions\``,
|
|
115
|
+
"error",
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Not awaited: pi awaits what a handler returns, so the start would wait for the backend.
|
|
120
|
+
void warnIfTuiTooOld(ctx);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The oldest `pi-subagents` Fito works with (ADR-002 Decision 3, "Version floor"): Fito's personas
|
|
126
|
+
* need a relative `subagentOnlyExtensions` path resolved against the persona's own folder, which
|
|
127
|
+
* 0.68.0 does and 0.50.0 does not. The backend cannot see `pi-subagents`, so this check and its
|
|
128
|
+
* message are built into the TUI (Task 15d.7b).
|
|
129
|
+
*/
|
|
130
|
+
const PI_SUBAGENTS_FLOOR = [0, 68, 0] as const;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Whether the `pi-subagents` that registered the `subagent` tool is older than the floor. pi names
|
|
134
|
+
* that package's folder in `sourceInfo.baseDir`, and the version is its `package.json`'s. `false`
|
|
135
|
+
* whenever the version cannot be read — no folder, no readable file, another package's file, or a
|
|
136
|
+
* version that does not start with three numbers — so a fault in the check never shows a message.
|
|
137
|
+
*/
|
|
138
|
+
function isBelowPiSubagentsFloor(sourceInfo: SourceInfo): boolean {
|
|
139
|
+
if (sourceInfo.baseDir === undefined) return false;
|
|
140
|
+
let version: unknown;
|
|
141
|
+
try {
|
|
142
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(sourceInfo.baseDir, "package.json"), "utf8"));
|
|
143
|
+
version = manifest?.name === "pi-subagents" ? manifest.version : undefined;
|
|
144
|
+
} catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (typeof version !== "string") return false;
|
|
148
|
+
|
|
149
|
+
const match = /^(\d+)\.(\d+)\.(\d+)/.exec(version);
|
|
150
|
+
if (match === null) return false;
|
|
151
|
+
const installed = match.slice(1).map(Number);
|
|
152
|
+
const differing = installed.findIndex((number, index) => number !== PI_SUBAGENTS_FLOOR[index]);
|
|
153
|
+
return differing !== -1 && installed[differing] < PI_SUBAGENTS_FLOOR[differing];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** The problem `type` of the backend's refusal of a TUI older than its minimum (Task 15d.7a). */
|
|
157
|
+
const TUI_TOO_OLD = "/problems/tui-too-old";
|
|
158
|
+
|
|
159
|
+
/** How long the start check waits for the backend before it gives up and shows nothing. */
|
|
160
|
+
const HEALTH_TIMEOUT_MS = 10_000;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Shows the backend's message when it refuses this TUI's version (Task 15d.7b). The backend refuses
|
|
164
|
+
* an old TUI at its first request (Task 15d.7a), which can be in the middle of a case; this asks once,
|
|
165
|
+
* as pi starts. `GET /actuator/health` needs no login and writes no `learning_events` row.
|
|
166
|
+
*
|
|
167
|
+
* The message is the backend's `detail`, not text built into the TUI: an old TUI is frozen code, and
|
|
168
|
+
* the backend's message can still change. Any other answer shows nothing — the backend is up, down,
|
|
169
|
+
* unreachable or silent past the timeout — because the check exists for one answer only.
|
|
170
|
+
*
|
|
171
|
+
* It never rejects. The answer can arrive after `/new`, `/resume`, `/fork` or `/reload` replaced the
|
|
172
|
+
* session, when pi refuses the old `ctx`, and an unhandled rejection can end the pi process.
|
|
173
|
+
*/
|
|
174
|
+
export async function warnIfTuiTooOld(ctx: ExtensionContext): Promise<void> {
|
|
175
|
+
let refusal: string | undefined;
|
|
176
|
+
try {
|
|
177
|
+
await createFitoApiClient().getHealth({ signal: AbortSignal.timeout(HEALTH_TIMEOUT_MS) });
|
|
178
|
+
} catch (error) {
|
|
179
|
+
if (error instanceof FitoApiError && error.type === TUI_TOO_OLD) refusal = error.message;
|
|
180
|
+
}
|
|
181
|
+
if (refusal === undefined) return;
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
ctx.ui.notify(refusal, "error");
|
|
185
|
+
} catch {
|
|
186
|
+
// The session was replaced while the call was out; the new session runs its own check.
|
|
187
|
+
}
|
|
188
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fito-tui",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Fito for pi: case-based practice for software engineers, in your terminal.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"extensions",
|
|
9
|
+
"skills",
|
|
10
|
+
"prompts",
|
|
11
|
+
"agents",
|
|
12
|
+
"shared",
|
|
13
|
+
"templates",
|
|
14
|
+
"!**/*.test.ts",
|
|
15
|
+
"!**/__fixtures__",
|
|
16
|
+
"!**/.impeccable"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=24"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.build.json",
|
|
23
|
+
"lint": "tsc --noEmit && npm run build",
|
|
24
|
+
"prepare": "npm run build",
|
|
25
|
+
"test": "node --test agents/*.test.ts extensions/*.test.ts prompts/*.test.ts skills/*/*.test.ts shared/*/*.test.ts",
|
|
26
|
+
"test:coverage": "node --test --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=tap --test-reporter-destination=tui-tap.txt --test-reporter=lcov --test-reporter-destination=lcov.info agents/*.test.ts extensions/*.test.ts prompts/*.test.ts skills/*/*.test.ts shared/*/*.test.ts"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"yaml": "2.9.0",
|
|
30
|
+
"zod": "4.4.3"
|
|
31
|
+
},
|
|
32
|
+
"pi": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"extensions/fito-startup.ts"
|
|
35
|
+
],
|
|
36
|
+
"skills": [
|
|
37
|
+
"skills"
|
|
38
|
+
],
|
|
39
|
+
"prompts": [
|
|
40
|
+
"prompts"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"pi-subagents": {
|
|
44
|
+
"agents": [
|
|
45
|
+
"agents"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^24.13.2",
|
|
53
|
+
"typebox": "1.1.38",
|
|
54
|
+
"typescript": "6.0.3"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Refresh the stored Fito access token
|
|
3
|
+
---
|
|
4
|
+
Refresh the learner's Fito access token.
|
|
5
|
+
|
|
6
|
+
Use the `fito-auth` skill (read its `SKILL.md`), then run:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
node <fito-auth skill dir>/auth-refresh.js
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This exchanges the stored refresh token for a fresh token pair via the backend
|
|
13
|
+
and rewrites `~/.fito/credentials`. If the learner is not logged in, it reports
|
|
14
|
+
that and exits non-zero — in that case suggest running `/fito-login`. Report the
|
|
15
|
+
result.
|