killeros 3.0.7 → 3.0.8
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/CHANGELOG.md +755 -734
- package/Killeros.ts +56 -55
- package/LICENSE +21 -21
- package/README.md +381 -364
- package/killeros/activity.ts +111 -111
- package/killeros/auto-compaction.ts +384 -384
- package/killeros/bounded-text.ts +25 -25
- package/killeros/change-receipt.ts +676 -676
- package/killeros/codex-fast-state.ts +55 -55
- package/killeros/codex-fast.ts +37 -37
- package/killeros/commands.ts +259 -259
- package/killeros/display.ts +60 -60
- package/killeros/errors.ts +19 -19
- package/killeros/footer.ts +540 -540
- package/killeros/goal-command.ts +37 -26
- package/killeros/goal-interface.ts +666 -585
- package/killeros/goal-runtime.ts +519 -516
- package/killeros/goal-settlement.ts +368 -368
- package/killeros/goal-state.ts +753 -724
- package/killeros/handoff.ts +327 -327
- package/killeros/hooks.ts +443 -470
- package/killeros/notifications.ts +135 -135
- package/killeros/passive-git-status.ts +391 -408
- package/killeros/personal-instructions.ts +122 -122
- package/killeros/question-ui.ts +269 -269
- package/killeros/question.ts +242 -242
- package/killeros/runtime.ts +156 -155
- package/killeros/safe-terminal-text.ts +6 -6
- package/killeros/secret-detector.ts +19 -19
- package/killeros/settings.ts +145 -145
- package/killeros/shell-ui.ts +418 -418
- package/killeros/variants.ts +13 -13
- package/killeros/worked-for.ts +502 -502
- package/package.json +71 -68
- package/themes/killeros.json +87 -87
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
|
|
3
|
-
type CodexFastStateListener = () => void;
|
|
4
|
-
|
|
5
|
-
interface CodexFastState {
|
|
6
|
-
enabled: boolean;
|
|
7
|
-
listeners: Set<CodexFastStateListener>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare global {
|
|
11
|
-
var __killerosCodexFastState: unknown;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Accepts process-global state only when it is safe to reuse across extension versions.
|
|
15
|
-
function isCodexFastState(value: unknown): value is CodexFastState {
|
|
16
|
-
return typeof value === "object" && value !== null
|
|
17
|
-
&& "enabled" in value && typeof value.enabled === "boolean"
|
|
18
|
-
&& "listeners" in value && value.listeners instanceof Set
|
|
19
|
-
&& [...value.listeners].every((listener) => typeof listener === "function");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const savedState = globalThis.__killerosCodexFastState;
|
|
23
|
-
const state: CodexFastState = isCodexFastState(savedState) ? savedState : {
|
|
24
|
-
enabled: typeof savedState === "object" && savedState !== null
|
|
25
|
-
&& "enabled" in savedState && savedState.enabled === true,
|
|
26
|
-
listeners: new Set<CodexFastStateListener>(),
|
|
27
|
-
};
|
|
28
|
-
globalThis.__killerosCodexFastState = state;
|
|
29
|
-
|
|
30
|
-
export function isCodexFastModel(model: ExtensionContext["model"]): boolean {
|
|
31
|
-
return model?.provider === "openai-codex"
|
|
32
|
-
|| (model?.provider === "openai" && model.api === "openai-responses"
|
|
33
|
-
&& (model.baseUrl === "https://api.openai.com/v1" || model.baseUrl === "https://api.openai.com/v1/"));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function isCodexFastEnabled(): boolean {
|
|
37
|
-
return state.enabled;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function toggleCodexFast(): boolean {
|
|
41
|
-
state.enabled = !state.enabled;
|
|
42
|
-
for (const listener of [...state.listeners]) listener();
|
|
43
|
-
return state.enabled;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function subscribeCodexFast(listener: CodexFastStateListener): () => void {
|
|
47
|
-
state.listeners.add(listener);
|
|
48
|
-
return () => state.listeners.delete(listener);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Test-only reset for the process-global state between isolated harnesses. */
|
|
52
|
-
export function resetCodexFastState(): void {
|
|
53
|
-
state.enabled = false;
|
|
54
|
-
state.listeners.clear();
|
|
55
|
-
}
|
|
1
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
type CodexFastStateListener = () => void;
|
|
4
|
+
|
|
5
|
+
interface CodexFastState {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
listeners: Set<CodexFastStateListener>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare global {
|
|
11
|
+
var __killerosCodexFastState: unknown;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Accepts process-global state only when it is safe to reuse across extension versions.
|
|
15
|
+
function isCodexFastState(value: unknown): value is CodexFastState {
|
|
16
|
+
return typeof value === "object" && value !== null
|
|
17
|
+
&& "enabled" in value && typeof value.enabled === "boolean"
|
|
18
|
+
&& "listeners" in value && value.listeners instanceof Set
|
|
19
|
+
&& [...value.listeners].every((listener) => typeof listener === "function");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const savedState = globalThis.__killerosCodexFastState;
|
|
23
|
+
const state: CodexFastState = isCodexFastState(savedState) ? savedState : {
|
|
24
|
+
enabled: typeof savedState === "object" && savedState !== null
|
|
25
|
+
&& "enabled" in savedState && savedState.enabled === true,
|
|
26
|
+
listeners: new Set<CodexFastStateListener>(),
|
|
27
|
+
};
|
|
28
|
+
globalThis.__killerosCodexFastState = state;
|
|
29
|
+
|
|
30
|
+
export function isCodexFastModel(model: ExtensionContext["model"]): boolean {
|
|
31
|
+
return model?.provider === "openai-codex"
|
|
32
|
+
|| (model?.provider === "openai" && model.api === "openai-responses"
|
|
33
|
+
&& (model.baseUrl === "https://api.openai.com/v1" || model.baseUrl === "https://api.openai.com/v1/"));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isCodexFastEnabled(): boolean {
|
|
37
|
+
return state.enabled;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function toggleCodexFast(): boolean {
|
|
41
|
+
state.enabled = !state.enabled;
|
|
42
|
+
for (const listener of [...state.listeners]) listener();
|
|
43
|
+
return state.enabled;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function subscribeCodexFast(listener: CodexFastStateListener): () => void {
|
|
47
|
+
state.listeners.add(listener);
|
|
48
|
+
return () => state.listeners.delete(listener);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Test-only reset for the process-global state between isolated harnesses. */
|
|
52
|
+
export function resetCodexFastState(): void {
|
|
53
|
+
state.enabled = false;
|
|
54
|
+
state.listeners.clear();
|
|
55
|
+
}
|
package/killeros/codex-fast.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { isCodexFastEnabled, isCodexFastModel, toggleCodexFast } from "./codex-fast-state.ts";
|
|
3
|
-
|
|
4
|
-
type RequestPayload = Record<string, unknown>;
|
|
5
|
-
|
|
6
|
-
function isRequestPayload(value: unknown): value is RequestPayload {
|
|
7
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function registerCodexFastMode(pi: ExtensionAPI): void {
|
|
11
|
-
pi.registerCommand("codex-fast", {
|
|
12
|
-
description: "Toggle or report Codex fast mode",
|
|
13
|
-
handler: async (args, ctx) => {
|
|
14
|
-
const trimmed = args.trim();
|
|
15
|
-
if (trimmed === "status") {
|
|
16
|
-
ctx.ui.notify(`Codex fast mode: ${isCodexFastEnabled() ? "enabled" : "disabled"}`, "info");
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (trimmed) {
|
|
20
|
-
ctx.ui.notify("Usage: /codex-fast [status]", "error");
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const enabled = toggleCodexFast();
|
|
25
|
-
ctx.ui.notify(`Fast ${enabled ? "enabled" : "disabled"}`, "info");
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
pi.on("before_provider_request", (event, ctx) => {
|
|
30
|
-
if (!isCodexFastEnabled() || !isCodexFastModel(ctx.model) || !isRequestPayload(event.payload)) {
|
|
31
|
-
return event.payload;
|
|
32
|
-
}
|
|
33
|
-
// The hook exposes no dispatched provider/API. Native requests must match the selected model.
|
|
34
|
-
if (ctx.model?.provider === "openai" && event.payload.model !== ctx.model.id) return event.payload;
|
|
35
|
-
return { ...event.payload, service_tier: "priority" };
|
|
36
|
-
});
|
|
37
|
-
}
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { isCodexFastEnabled, isCodexFastModel, toggleCodexFast } from "./codex-fast-state.ts";
|
|
3
|
+
|
|
4
|
+
type RequestPayload = Record<string, unknown>;
|
|
5
|
+
|
|
6
|
+
function isRequestPayload(value: unknown): value is RequestPayload {
|
|
7
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function registerCodexFastMode(pi: ExtensionAPI): void {
|
|
11
|
+
pi.registerCommand("codex-fast", {
|
|
12
|
+
description: "Toggle or report Codex fast mode",
|
|
13
|
+
handler: async (args, ctx) => {
|
|
14
|
+
const trimmed = args.trim();
|
|
15
|
+
if (trimmed === "status") {
|
|
16
|
+
ctx.ui.notify(`Codex fast mode: ${isCodexFastEnabled() ? "enabled" : "disabled"}`, "info");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (trimmed) {
|
|
20
|
+
ctx.ui.notify("Usage: /codex-fast [status]", "error");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const enabled = toggleCodexFast();
|
|
25
|
+
ctx.ui.notify(`Fast ${enabled ? "enabled" : "disabled"}`, "info");
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
pi.on("before_provider_request", (event, ctx) => {
|
|
30
|
+
if (!isCodexFastEnabled() || !isCodexFastModel(ctx.model) || !isRequestPayload(event.payload)) {
|
|
31
|
+
return event.payload;
|
|
32
|
+
}
|
|
33
|
+
// The hook exposes no dispatched provider/API. Native requests must match the selected model.
|
|
34
|
+
if (ctx.model?.provider === "openai" && event.payload.model !== ctx.model.id) return event.payload;
|
|
35
|
+
return { ...event.payload, service_tier: "priority" };
|
|
36
|
+
});
|
|
37
|
+
}
|