@fractaal/pi-goal-x 0.20.1 → 0.28.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/README.md +42 -290
- package/dist/goal-auditor.d.ts +7 -61
- package/dist/goal-auditor.js +98 -300
- package/dist/goal-auditor.js.map +1 -1
- package/dist/goal-contract.d.ts +205 -0
- package/dist/goal-contract.js +135 -0
- package/dist/goal-contract.js.map +1 -0
- package/dist/goal-transcript-events.d.ts +54 -0
- package/dist/goal-transcript-events.js +177 -0
- package/dist/goal-transcript-events.js.map +1 -0
- package/dist/goal-widget.d.ts +13 -0
- package/dist/goal-widget.js +45 -0
- package/dist/goal-widget.js.map +1 -0
- package/dist/goal.d.ts +8 -49
- package/dist/goal.js +519 -3643
- package/dist/goal.js.map +1 -1
- package/dist/legacy-migration.d.ts +61 -0
- package/dist/legacy-migration.js +306 -0
- package/dist/legacy-migration.js.map +1 -0
- package/docs/architecture.md +14 -232
- package/extensions/goal-auditor.ts +108 -363
- package/extensions/goal-contract.ts +149 -0
- package/extensions/goal-transcript-events.ts +194 -0
- package/extensions/goal-widget.ts +50 -0
- package/extensions/goal.ts +557 -3927
- package/extensions/legacy-migration.ts +340 -0
- package/package.json +46 -19
- package/dist/goal-compaction.d.ts +0 -10
- package/dist/goal-compaction.js +0 -104
- package/dist/goal-compaction.js.map +0 -1
- package/dist/goal-core.d.ts +0 -19
- package/dist/goal-core.js +0 -66
- package/dist/goal-core.js.map +0 -1
- package/dist/goal-draft.d.ts +0 -71
- package/dist/goal-draft.js +0 -201
- package/dist/goal-draft.js.map +0 -1
- package/dist/goal-ledger.d.ts +0 -139
- package/dist/goal-ledger.js +0 -306
- package/dist/goal-ledger.js.map +0 -1
- package/dist/goal-policy.d.ts +0 -127
- package/dist/goal-policy.js +0 -359
- package/dist/goal-policy.js.map +0 -1
- package/dist/goal-pool.d.ts +0 -17
- package/dist/goal-pool.js +0 -85
- package/dist/goal-pool.js.map +0 -1
- package/dist/goal-questionnaire.d.ts +0 -56
- package/dist/goal-questionnaire.js +0 -733
- package/dist/goal-questionnaire.js.map +0 -1
- package/dist/goal-record.d.ts +0 -94
- package/dist/goal-record.js +0 -155
- package/dist/goal-record.js.map +0 -1
- package/dist/goal-settings.d.ts +0 -56
- package/dist/goal-settings.js +0 -184
- package/dist/goal-settings.js.map +0 -1
- package/dist/goal-tool-names.d.ts +0 -20
- package/dist/goal-tool-names.js +0 -69
- package/dist/goal-tool-names.js.map +0 -1
- package/dist/prompts/goal-prompts.d.ts +0 -17
- package/dist/prompts/goal-prompts.js +0 -304
- package/dist/prompts/goal-prompts.js.map +0 -1
- package/dist/storage/goal-files.d.ts +0 -40
- package/dist/storage/goal-files.js +0 -320
- package/dist/storage/goal-files.js.map +0 -1
- package/dist/widgets/goal-escape-dialog.d.ts +0 -15
- package/dist/widgets/goal-escape-dialog.js +0 -118
- package/dist/widgets/goal-escape-dialog.js.map +0 -1
- package/dist/widgets/goal-notifications.d.ts +0 -5
- package/dist/widgets/goal-notifications.js +0 -9
- package/dist/widgets/goal-notifications.js.map +0 -1
- package/dist/widgets/goal-widget.d.ts +0 -58
- package/dist/widgets/goal-widget.js +0 -282
- package/dist/widgets/goal-widget.js.map +0 -1
- package/dist/widgets/task-list-overlay.d.ts +0 -8
- package/dist/widgets/task-list-overlay.js +0 -321
- package/dist/widgets/task-list-overlay.js.map +0 -1
- package/docs/agent-flow-design.md +0 -432
- package/docs/agentic-runtime-prd.md +0 -764
- package/docs/goal-ts-refactor-test-strategy.md +0 -82
- package/docs/pi-autoresearch-survey.md +0 -45
- package/extensions/goal-compaction.ts +0 -133
- package/extensions/goal-core.ts +0 -77
- package/extensions/goal-draft.ts +0 -263
- package/extensions/goal-ledger.ts +0 -354
- package/extensions/goal-policy.ts +0 -389
- package/extensions/goal-pool.ts +0 -98
- package/extensions/goal-questionnaire.ts +0 -779
- package/extensions/goal-record.ts +0 -256
- package/extensions/goal-settings.ts +0 -181
- package/extensions/goal-tool-names.ts +0 -76
- package/extensions/prompts/goal-prompts.ts +0 -308
- package/extensions/storage/goal-files.ts +0 -352
- package/extensions/widgets/goal-escape-dialog.ts +0 -146
- package/extensions/widgets/goal-notifications.ts +0 -9
- package/extensions/widgets/goal-widget.ts +0 -378
- package/extensions/widgets/task-list-overlay.ts +0 -389
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
2
|
+
export class GoalWidget {
|
|
3
|
+
tui;
|
|
4
|
+
theme;
|
|
5
|
+
getState;
|
|
6
|
+
isAuditing;
|
|
7
|
+
constructor(tui, theme, getState, isAuditing) {
|
|
8
|
+
this.tui = tui;
|
|
9
|
+
this.theme = theme;
|
|
10
|
+
this.getState = getState;
|
|
11
|
+
this.isAuditing = isAuditing;
|
|
12
|
+
}
|
|
13
|
+
update() {
|
|
14
|
+
this.tui.requestRender();
|
|
15
|
+
}
|
|
16
|
+
render(width) {
|
|
17
|
+
const goal = this.getState().goal;
|
|
18
|
+
if (!goal)
|
|
19
|
+
return [];
|
|
20
|
+
const status = this.isAuditing()
|
|
21
|
+
? { icon: "◌", label: "auditing", color: "warning" }
|
|
22
|
+
: goal.status === "complete"
|
|
23
|
+
? { icon: "✓", label: "complete", color: "success" }
|
|
24
|
+
: goal.status === "paused"
|
|
25
|
+
? { icon: "◐", label: "paused", color: "warning" }
|
|
26
|
+
: { icon: "●", label: "running", color: "accent" };
|
|
27
|
+
const lines = [
|
|
28
|
+
`${this.theme.fg(status.color, status.icon)} ${this.theme.fg(status.color, this.theme.bold("Goal"))} ${this.theme.fg("muted", status.label)}`,
|
|
29
|
+
`${this.theme.fg("dim", "└─")} ${this.theme.fg("text", goal.objective.replace(/\s+/g, " ").trim())}`,
|
|
30
|
+
];
|
|
31
|
+
if (goal.pause) {
|
|
32
|
+
lines.push(`${this.theme.fg("warning", "blocker")} ${this.theme.fg("warning", goal.pause.reason)}`);
|
|
33
|
+
if (goal.pause.suggestedAction)
|
|
34
|
+
lines.push(`${this.theme.fg("dim", "next")} ${this.theme.fg("muted", goal.pause.suggestedAction)}`);
|
|
35
|
+
}
|
|
36
|
+
if (goal.lastAuditRejection) {
|
|
37
|
+
lines.push(`${this.theme.fg("warning", "audit")} ${this.theme.fg("muted", goal.lastAuditRejection.report.replace(/\s+/g, " ").trim())}`);
|
|
38
|
+
}
|
|
39
|
+
return lines.map((line) => truncateToWidth(line, Math.max(1, width), "…"));
|
|
40
|
+
}
|
|
41
|
+
invalidate() {
|
|
42
|
+
this.update();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=goal-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-widget.js","sourceRoot":"","sources":["../extensions/goal-widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,OAAO,UAAU;IACL,GAAG,CAAM;IACT,KAAK,CAAQ;IACb,QAAQ,CAAkB;IAC1B,UAAU,CAAgB;IAE3C,YAAY,GAAQ,EAAE,KAAY,EAAE,QAAyB,EAAE,UAAyB;QACvF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAED,MAAM;QACL,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,KAAa;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE;YAC/B,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,S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AAI,CAAC,KAAK,CAAC,eAAe;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACrI,CAAC;QACD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1I,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,UAAU;QACT,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;CACD"}
|
package/dist/goal.d.ts
CHANGED
|
@@ -1,49 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
originalTopic: string;
|
|
10
|
-
objective: string;
|
|
11
|
-
autoContinue: boolean;
|
|
12
|
-
verificationContract?: string;
|
|
13
|
-
tasks?: GoalTask[];
|
|
14
|
-
auditorEnabledDefault: boolean;
|
|
15
|
-
} | {
|
|
16
|
-
id: string;
|
|
17
|
-
kind: "goal-tweak";
|
|
18
|
-
focus: GoalDraftingFocus;
|
|
19
|
-
title: string;
|
|
20
|
-
currentObjective: string;
|
|
21
|
-
newObjective: string;
|
|
22
|
-
changeSummary: string;
|
|
23
|
-
verificationContract?: string;
|
|
24
|
-
auditorEnabledDefault: boolean;
|
|
25
|
-
} | {
|
|
26
|
-
id: string;
|
|
27
|
-
kind: "task-list";
|
|
28
|
-
focus: "goal";
|
|
29
|
-
title: string;
|
|
30
|
-
currentObjective: string;
|
|
31
|
-
tasks: GoalTask[];
|
|
32
|
-
blockCompletion: boolean;
|
|
33
|
-
auditorEnabledDefault: boolean;
|
|
34
|
-
};
|
|
35
|
-
export interface GoalStateEventPayload {
|
|
36
|
-
version: 1;
|
|
37
|
-
emittedAt: string;
|
|
38
|
-
reason: string;
|
|
39
|
-
goal: GoalRecord | null;
|
|
40
|
-
focusedGoalId: string | null;
|
|
41
|
-
openGoalCount: number;
|
|
42
|
-
}
|
|
43
|
-
export interface GoalProposalEventPayload {
|
|
44
|
-
version: 1;
|
|
45
|
-
emittedAt: string;
|
|
46
|
-
proposal: StructuredGoalProposal | null;
|
|
47
|
-
reason?: string;
|
|
48
|
-
}
|
|
49
|
-
export default function goalExtension(pi: ExtensionAPI): void;
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { runGoalCompletionAuditor } from "./goal-auditor.ts";
|
|
3
|
+
export * from "./goal-contract.ts";
|
|
4
|
+
export * from "./goal-transcript-events.ts";
|
|
5
|
+
export * from "./legacy-migration.ts";
|
|
6
|
+
export default function goalExtension(pi: ExtensionAPI, dependencies?: {
|
|
7
|
+
runCompletionAuditor?: typeof runGoalCompletionAuditor;
|
|
8
|
+
}): void;
|