indusagi-coding-agent 0.2.5 → 0.2.9
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 +9 -0
- package/README.md +9 -5
- package/dist/entry.js +14267 -24282
- package/dist/guardrails.js +924 -7867
- package/dist/index.js +13706 -23775
- package/package.json +3 -2
- package/src/_decls/entry.ts +18 -0
- package/src/_decls/guardrails.ts +35 -0
- package/src/_decls/index.ts +26 -0
- package/src/addons/contract.ts +236 -0
- package/src/addons/dispatch/event-dispatcher.ts +164 -0
- package/src/addons/dispatch/index.ts +25 -0
- package/src/addons/dispatch/tool-interceptor.ts +208 -0
- package/src/addons/host.ts +225 -0
- package/src/addons/index.ts +112 -0
- package/src/addons/manifest.ts +158 -0
- package/src/addons/sandbox.ts +170 -0
- package/src/addons/surface.ts +78 -0
- package/src/boot/auth-vault.ts +195 -0
- package/src/boot/boot.ts +138 -0
- package/src/boot/contract.ts +238 -0
- package/src/boot/heap.ts +59 -0
- package/src/boot/index.ts +28 -0
- package/src/boot/invocation.ts +93 -0
- package/src/boot/runners/addon-wiring.ts +153 -0
- package/src/boot/runners/checkpoint.ts +169 -0
- package/src/boot/runners/delegate-runner.ts +294 -0
- package/src/boot/runners/index.ts +13 -0
- package/src/boot/runners/link-runner.ts +45 -0
- package/src/boot/runners/memdir.ts +168 -0
- package/src/boot/runners/oneshot-runner.ts +58 -0
- package/src/boot/runners/read-state.ts +90 -0
- package/src/boot/runners/registry.ts +42 -0
- package/src/boot/runners/repl-runner.ts +143 -0
- package/src/boot/runners/server-mode.ts +121 -0
- package/src/boot/runners/session.ts +641 -0
- package/src/boot/server-token.ts +148 -0
- package/src/boot/stages.ts +167 -0
- package/src/boot/upgrade/apply.ts +94 -0
- package/src/boot/upgrade/index.ts +13 -0
- package/src/boot/upgrade/upgrades.ts +289 -0
- package/src/briefing/compose.ts +150 -0
- package/src/briefing/context-docs.ts +19 -0
- package/src/briefing/contract.ts +717 -0
- package/src/briefing/index.ts +31 -0
- package/src/briefing/macros.ts +97 -0
- package/src/briefing/skills.ts +47 -0
- package/src/capability-deck/bridge-ledger/index.ts +27 -0
- package/src/capability-deck/bridge-ledger/key.ts +67 -0
- package/src/capability-deck/bridge-ledger/ledger.ts +131 -0
- package/src/capability-deck/bridge-ledger/network.ts +117 -0
- package/src/capability-deck/builtin-bridge.ts +312 -0
- package/src/capability-deck/cards/bg-process-card.ts +335 -0
- package/src/capability-deck/cards/index.ts +115 -0
- package/src/capability-deck/cards/memory-card.ts +146 -0
- package/src/capability-deck/cards/plan-file.ts +97 -0
- package/src/capability-deck/cards/plan-tools.ts +185 -0
- package/src/capability-deck/cards/saas-card.ts +183 -0
- package/src/capability-deck/cards/task-card.ts +207 -0
- package/src/capability-deck/cards/todo-card.ts +168 -0
- package/src/capability-deck/cards/workflow-card.ts +247 -0
- package/src/capability-deck/contract.ts +388 -0
- package/src/capability-deck/index.ts +48 -0
- package/src/capability-deck/manifest.ts +109 -0
- package/src/capability-deck/provision.ts +169 -0
- package/src/channels/contract.ts +191 -0
- package/src/channels/framer.ts +50 -0
- package/src/channels/index.ts +101 -0
- package/src/channels/link/dialog.ts +129 -0
- package/src/channels/link/driver.ts +190 -0
- package/src/channels/link/index.ts +34 -0
- package/src/channels/link/server.ts +134 -0
- package/src/channels/oneshot.ts +90 -0
- package/src/channels/ops.ts +65 -0
- package/src/channels/session-ops.ts +81 -0
- package/src/conductor/bash-guard.ts +599 -0
- package/src/conductor/catalog/catalog.ts +116 -0
- package/src/conductor/catalog/index.ts +8 -0
- package/src/conductor/catalog/matcher.ts +134 -0
- package/src/conductor/conductor.ts +234 -0
- package/src/conductor/contract.ts +842 -0
- package/src/conductor/diagnostics.ts +227 -0
- package/src/conductor/index.ts +33 -0
- package/src/conductor/permissions.ts +588 -0
- package/src/conductor/quota-error.ts +49 -0
- package/src/conductor/signal-hub/hub.ts +46 -0
- package/src/conductor/signal-hub/index.ts +2 -0
- package/src/conductor/signal-hub/translate.test.ts +81 -0
- package/src/conductor/signal-hub/translate.ts +74 -0
- package/src/conductor/skill-parse/index.ts +2 -0
- package/src/conductor/skill-parse/parse.ts +108 -0
- package/src/conductor/transcript-store/index.ts +22 -0
- package/src/conductor/transcript-store/serialize.ts +116 -0
- package/src/conductor/transcript-store/store.ts +205 -0
- package/src/console/auth-status.ts +56 -0
- package/src/console/components/AgentsView.ts +165 -0
- package/src/console/components/BackgroundAgents.ts +155 -0
- package/src/console/components/Banner.ts +334 -0
- package/src/console/components/Composer.ts +94 -0
- package/src/console/components/StatusBar.ts +49 -0
- package/src/console/components/TerminalConsole.ts +1090 -0
- package/src/console/components/WorkingIndicator.ts +98 -0
- package/src/console/components/banner-sweep.ts +24 -0
- package/src/console/components/welcome.ts +74 -0
- package/src/console/contract.ts +630 -0
- package/src/console/index.ts +34 -0
- package/src/console/input/complete.ts +127 -0
- package/src/console/input/dir-reader.ts +34 -0
- package/src/console/input/index.ts +23 -0
- package/src/console/input/keymap.ts +159 -0
- package/src/console/input/paste.ts +104 -0
- package/src/console/mount.ts +56 -0
- package/src/console/overlays/approval-queue.ts +57 -0
- package/src/console/overlays/approval.ts +130 -0
- package/src/console/overlays/auth.ts +342 -0
- package/src/console/overlays/boards.ts +308 -0
- package/src/console/overlays/host.ts +36 -0
- package/src/console/overlays/index.ts +26 -0
- package/src/console/overlays/pickers.ts +258 -0
- package/src/console/overlays/sessions.ts +190 -0
- package/src/console/reducer.ts +182 -0
- package/src/console/slash/builtins.ts +81 -0
- package/src/console/slash/commands/dynamic.ts +83 -0
- package/src/console/slash/commands/integrations.ts +695 -0
- package/src/console/slash/commands/shared.ts +75 -0
- package/src/console/slash/commands/transcript.ts +263 -0
- package/src/console/slash/commands/workbench.ts +246 -0
- package/src/console/slash/index.ts +15 -0
- package/src/console/slash/registry.ts +70 -0
- package/src/console/slash/resolve.ts +63 -0
- package/src/console/startup.ts +209 -0
- package/src/console/theme/adapter.ts +45 -0
- package/src/console/theme/index.ts +7 -0
- package/src/console/theme/palette.ts +68 -0
- package/src/console/theme/resolve.ts +39 -0
- package/src/console/theme/tokens.ts +71 -0
- package/src/entry.ts +55 -0
- package/src/guardrails.ts +37 -0
- package/src/index.ts +18 -0
- package/src/insight/channel.ts +88 -0
- package/src/insight/contract.ts +185 -0
- package/src/insight/index.ts +110 -0
- package/src/insight/recorder.ts +213 -0
- package/src/insight/redaction.ts +157 -0
- package/src/insight/replay.ts +158 -0
- package/src/insight/sampling.ts +70 -0
- package/src/insight/serialize.ts +50 -0
- package/src/insight/sinks/console.ts +64 -0
- package/src/insight/sinks/file.ts +40 -0
- package/src/insight/sinks/index.ts +24 -0
- package/src/insight/sinks/stream.ts +54 -0
- package/src/integrations/sarvam/attach.ts +239 -0
- package/src/integrations/sarvam/config.ts +156 -0
- package/src/integrations/sarvam/index.ts +25 -0
- package/src/integrations/sarvam/sarvam.test.ts +60 -0
- package/src/integrations/sarvam/types.ts +27 -0
- package/src/integrations/zoho/attach.ts +342 -0
- package/src/integrations/zoho/config.ts +125 -0
- package/src/integrations/zoho/index.ts +27 -0
- package/src/integrations/zoho/types.ts +21 -0
- package/src/integrations/zoho/zoho.test.ts +50 -0
- package/src/kit/clipboard-image.ts +107 -0
- package/src/kit/external-editor.ts +48 -0
- package/src/kit/image.ts +59 -0
- package/src/kit/index.ts +51 -0
- package/src/kit/shell.ts +19 -0
- package/src/kit/tool-fetch.ts +85 -0
- package/src/launch/catalog.ts +148 -0
- package/src/launch/contract.ts +187 -0
- package/src/launch/credentials.ts +625 -0
- package/src/launch/index.ts +98 -0
- package/src/launch/invocation/attachments.ts +179 -0
- package/src/launch/invocation/flags.ts +196 -0
- package/src/launch/invocation/index.ts +25 -0
- package/src/launch/invocation/read.ts +260 -0
- package/src/launch/invocation/usage.ts +67 -0
- package/src/launch/login.ts +324 -0
- package/src/launch/oauth.test.ts +18 -0
- package/src/launch/oauth.ts +203 -0
- package/src/launch/packages.ts +194 -0
- package/src/launch/pickers.ts +189 -0
- package/src/runtime-bridge/bridges/_drive.ts +96 -0
- package/src/runtime-bridge/bridges/builtins.ts +68 -0
- package/src/runtime-bridge/bridges/claude-cli.ts +123 -0
- package/src/runtime-bridge/bridges/codex-cli.ts +142 -0
- package/src/runtime-bridge/bridges/index.ts +33 -0
- package/src/runtime-bridge/bridges/indusagi-cli.ts +155 -0
- package/src/runtime-bridge/broker.ts +227 -0
- package/src/runtime-bridge/contract.ts +122 -0
- package/src/runtime-bridge/index.ts +79 -0
- package/src/runtime-bridge/sink.ts +180 -0
- package/src/sessions/contract.ts +81 -0
- package/src/sessions/index.ts +13 -0
- package/src/sessions/library.ts +229 -0
- package/src/settings/contract.ts +114 -0
- package/src/settings/index.ts +32 -0
- package/src/settings/manager.ts +117 -0
- package/src/transcript-export/index.ts +45 -0
- package/src/transcript-export/publish.ts +260 -0
- package/src/transcript-export/sgr.ts +315 -0
- package/src/transcript-export/template.ts +272 -0
- package/src/transcript-export/theme-bridge.ts +150 -0
- package/src/window-budget/budget/estimate.ts +135 -0
- package/src/window-budget/budget/gate.ts +33 -0
- package/src/window-budget/budget/index.ts +16 -0
- package/src/window-budget/budget/slice.ts +56 -0
- package/src/window-budget/condenser.ts +58 -0
- package/src/window-budget/contract.ts +184 -0
- package/src/window-budget/index.ts +19 -0
- package/src/window-budget/microcompact.ts +95 -0
- package/src/window-budget/rehydrate.ts +136 -0
- package/src/window-budget/summarize/condense.ts +103 -0
- package/src/window-budget/summarize/index.ts +14 -0
- package/src/window-budget/summarize/prompt.ts +149 -0
- package/src/workflow-engine/agent-runner.ts +181 -0
- package/src/workflow-engine/display.ts +224 -0
- package/src/workflow-engine/engine.ts +294 -0
- package/src/workflow-engine/index.ts +23 -0
- package/src/workflow-engine/parse.ts +172 -0
- package/src/workflow-engine/structured-output.ts +35 -0
- package/src/workspace/brand.ts +29 -0
- package/src/workspace/index.ts +18 -0
- package/src/workspace/locator.ts +103 -0
- package/src/workspace/runtime-detect.ts +64 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkingIndicator — the live "agent is working" affordance.
|
|
3
|
+
*/
|
|
4
|
+
import React, { useEffect, useState } from "indusagi/react-host";
|
|
5
|
+
import { Box, Text } from "indusagi/react-host/ink";
|
|
6
|
+
import { jsx, jsxs } from "indusagi/react-host/jsx-runtime";
|
|
7
|
+
import type { InkThemeAdapter } from "indusagi/react-ink";
|
|
8
|
+
|
|
9
|
+
const { useRef } = React;
|
|
10
|
+
|
|
11
|
+
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
12
|
+
const FRAME_MS = 120;
|
|
13
|
+
const WORD_MS = 4000;
|
|
14
|
+
|
|
15
|
+
export const WORKING_WORDS = [
|
|
16
|
+
"Cogitating",
|
|
17
|
+
"Pondering",
|
|
18
|
+
"Noodling",
|
|
19
|
+
"Simmering",
|
|
20
|
+
"Brewing",
|
|
21
|
+
"Percolating",
|
|
22
|
+
"Conjuring",
|
|
23
|
+
"Tinkering",
|
|
24
|
+
"Wrangling",
|
|
25
|
+
"Synthesizing",
|
|
26
|
+
"Computing",
|
|
27
|
+
"Musing",
|
|
28
|
+
"Scheming",
|
|
29
|
+
"Hatching",
|
|
30
|
+
"Whirring",
|
|
31
|
+
"Crunching",
|
|
32
|
+
"Spelunking",
|
|
33
|
+
"Untangling",
|
|
34
|
+
"Marinating",
|
|
35
|
+
"Ruminating",
|
|
36
|
+
"Architecting",
|
|
37
|
+
"Finagling",
|
|
38
|
+
"Concocting",
|
|
39
|
+
"Deliberating",
|
|
40
|
+
"Orchestrating",
|
|
41
|
+
"Calibrating",
|
|
42
|
+
"Channeling",
|
|
43
|
+
"Vibing",
|
|
44
|
+
"Forging",
|
|
45
|
+
"Assembling"
|
|
46
|
+
] as const;
|
|
47
|
+
|
|
48
|
+
export function pickWord(index: number): string {
|
|
49
|
+
const n = WORKING_WORDS.length;
|
|
50
|
+
return WORKING_WORDS[(((index % n) + n) % n) as 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function phaseLabel(phase: string | undefined): string | null {
|
|
54
|
+
switch (phase) {
|
|
55
|
+
case "tooling":
|
|
56
|
+
return "Running tools";
|
|
57
|
+
case "condensing":
|
|
58
|
+
return "Compacting context";
|
|
59
|
+
default:
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface WorkingIndicatorProps {
|
|
65
|
+
readonly theme: InkThemeAdapter;
|
|
66
|
+
readonly busy: boolean;
|
|
67
|
+
readonly phase?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function WorkingIndicator({ theme, busy, phase }: WorkingIndicatorProps) {
|
|
71
|
+
const [frame, setFrame] = useState(0);
|
|
72
|
+
const startRef = useRef<number | null>(null);
|
|
73
|
+
const wordOffsetRef = useRef(0);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!busy) {
|
|
76
|
+
startRef.current = null;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (startRef.current === null) {
|
|
80
|
+
startRef.current = Date.now();
|
|
81
|
+
wordOffsetRef.current = Math.floor(Math.random() * WORKING_WORDS.length);
|
|
82
|
+
}
|
|
83
|
+
const id = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), FRAME_MS);
|
|
84
|
+
return () => clearInterval(id);
|
|
85
|
+
}, [busy]);
|
|
86
|
+
if (!busy) return null;
|
|
87
|
+
const elapsedMs = startRef.current !== null ? Date.now() - startRef.current : 0;
|
|
88
|
+
const elapsedSec = Math.floor(elapsedMs / 1000);
|
|
89
|
+
const spinner = SPINNER_FRAMES[frame % SPINNER_FRAMES.length];
|
|
90
|
+
const label = phaseLabel(phase) ?? pickWord(wordOffsetRef.current + Math.floor(elapsedMs / WORD_MS));
|
|
91
|
+
return jsxs(Box, {
|
|
92
|
+
marginTop: 1,
|
|
93
|
+
children: [
|
|
94
|
+
jsx(Text, { children: theme.color("accent", `${spinner} ${label}… `) }),
|
|
95
|
+
jsx(Text, { children: theme.muted(`(${elapsedSec}s · esc to interrupt)`) })
|
|
96
|
+
]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banner colour-sweep helpers.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const WELCOME_FALLBACK = "Welcome back!";
|
|
6
|
+
const MAX_NAME = 40;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Format the personalized welcome greeting.
|
|
10
|
+
*/
|
|
11
|
+
export function welcomeLine(name?: string): string {
|
|
12
|
+
if (name === void 0) return WELCOME_FALLBACK;
|
|
13
|
+
const trimmed = name.trim();
|
|
14
|
+
if (trimmed.length === 0 || trimmed.length > MAX_NAME) return WELCOME_FALLBACK;
|
|
15
|
+
return `Welcome back, ${trimmed}!`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The frozen sweep colour for one wordmark row.
|
|
20
|
+
*/
|
|
21
|
+
export function rowGradient(rowIndex: number, rowCount: number, primaryHex: string, secondaryHex: string): string {
|
|
22
|
+
if (rowCount <= 1) return primaryHex;
|
|
23
|
+
return primaryHex;
|
|
24
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welcome-card content & per-session variation.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface MascotFace {
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly eyes: readonly [string, string];
|
|
8
|
+
readonly mouth: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const MASCOTS: readonly MascotFace[] = [
|
|
12
|
+
{ key: "focus", eyes: ["●", "●"], mouth: "───" },
|
|
13
|
+
{ key: "happy", eyes: ["^", "^"], mouth: "◡◡◡" },
|
|
14
|
+
{ key: "chill", eyes: ["•", "•"], mouth: " ◡ " },
|
|
15
|
+
{ key: "spark", eyes: ["✦", "✦"], mouth: "oOo" },
|
|
16
|
+
{ key: "wink", eyes: ["•", "-"], mouth: "◡◡◡" },
|
|
17
|
+
{ key: "robo", eyes: ["◢", "◣"], mouth: "═══" }
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export type MascotTone = "head" | "eye" | "mouth" | "feet";
|
|
21
|
+
|
|
22
|
+
export interface MascotSegment {
|
|
23
|
+
readonly text: string;
|
|
24
|
+
readonly tone: MascotTone;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function mascotRows(face: MascotFace): readonly (readonly MascotSegment[])[] {
|
|
28
|
+
const head = (text: string): MascotSegment => ({ text, tone: "head" });
|
|
29
|
+
return [
|
|
30
|
+
[head("╭───────╮")],
|
|
31
|
+
[head("│ "), { text: face.eyes[0], tone: "eye" }, head(" "), { text: face.eyes[1], tone: "eye" }, head(" │")],
|
|
32
|
+
[head("│ "), { text: face.mouth, tone: "mouth" }, head(" │")],
|
|
33
|
+
[head("╰─┬───┬─╯")],
|
|
34
|
+
[{ text: " ╹ ╹", tone: "feet" }]
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const TIPS: readonly string[] = [
|
|
39
|
+
"Run /init to create a CLAUDE.md file with instructions for IndusCode",
|
|
40
|
+
'Ask in plain English — try "fix the failing tests" or "explain src/agent.ts"',
|
|
41
|
+
"Shift+Tab cycles permission modes: auto → plan → accept-edits",
|
|
42
|
+
"Type @ to attach a file, or paste an image straight into the prompt",
|
|
43
|
+
"Run /status to check your model, account, and connectivity",
|
|
44
|
+
"Use /skills to discover specialized helpers for the task at hand"
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const WHATS_NEW: readonly string[] = [
|
|
48
|
+
"Ctrl+X runs your newest queued message NOW — the current run stops cleanly",
|
|
49
|
+
"/compact shows live progress, resets to a fresh screen, and lists carried files",
|
|
50
|
+
'"Allow always" is remembered for the session; sub-agents respect your permission mode'
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
function wrapIndex(seed: number, len: number): number {
|
|
54
|
+
if (len <= 0) return 0;
|
|
55
|
+
const n = Math.trunc(seed);
|
|
56
|
+
return ((n % len) + len) % len;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface WelcomeVariant {
|
|
60
|
+
readonly mascot: MascotFace;
|
|
61
|
+
readonly tip: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function pickWelcomeVariant(seed: number): WelcomeVariant {
|
|
65
|
+
const mascot = MASCOTS[wrapIndex(seed, MASCOTS.length)];
|
|
66
|
+
const tip = TIPS[wrapIndex(Math.trunc(seed / MASCOTS.length), TIPS.length)];
|
|
67
|
+
return { mascot, tip };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const PINNED_WELCOME_SEED = 12;
|
|
71
|
+
|
|
72
|
+
export function randomWelcomeSeed(): number {
|
|
73
|
+
return Math.floor(Math.random() * 1e9);
|
|
74
|
+
}
|