indusagi-coding-agent 0.2.8 → 0.2.10
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 +7 -0
- package/dist/entry.js +4 -4
- package/dist/index.js +4 -4
- 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,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer — the prompt-input surface.
|
|
3
|
+
*/
|
|
4
|
+
import { Box, Text } from "indusagi/react-host/ink";
|
|
5
|
+
import { jsx, jsxs } from "indusagi/react-host/jsx-runtime";
|
|
6
|
+
import type { InkThemeAdapter } from "indusagi/react-ink";
|
|
7
|
+
import type { Suggestion } from "../input/index.js";
|
|
8
|
+
|
|
9
|
+
const PROMPT_GLYPH = "› ";
|
|
10
|
+
const SUGGESTION_WINDOW = 8;
|
|
11
|
+
const NAME_COLUMN_CAP = 24;
|
|
12
|
+
const NAME_COLUMN_FLOOR = 8;
|
|
13
|
+
|
|
14
|
+
function clampName(label: string, width: number): string {
|
|
15
|
+
if (label.length <= width) return label;
|
|
16
|
+
if (width <= 1) return label.slice(0, width);
|
|
17
|
+
return `${label.slice(0, width - 1)}…`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function bufferWithCaret(buffer: string, caret: number) {
|
|
21
|
+
const before = buffer.slice(0, caret);
|
|
22
|
+
const under = caret < buffer.length ? buffer[caret] : " ";
|
|
23
|
+
const after = caret < buffer.length ? buffer.slice(caret + 1) : "";
|
|
24
|
+
return jsxs(Text, {
|
|
25
|
+
children: [before, jsx(Text, { inverse: true, children: under }), after]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ComposerProps {
|
|
30
|
+
readonly theme: InkThemeAdapter;
|
|
31
|
+
readonly buffer: string;
|
|
32
|
+
readonly caret: number;
|
|
33
|
+
readonly busy: boolean;
|
|
34
|
+
readonly suggestions: readonly Suggestion[];
|
|
35
|
+
readonly highlight: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function Composer({ theme, buffer, caret, busy, suggestions, highlight }: ComposerProps) {
|
|
39
|
+
const shown = suggestions.slice(0, SUGGESTION_WINDOW);
|
|
40
|
+
const borderColor = theme.colors.borderMuted ?? theme.colors.accent ?? "gray";
|
|
41
|
+
const nameWidth = shown.length > 0
|
|
42
|
+
? Math.max(NAME_COLUMN_FLOOR, Math.min(NAME_COLUMN_CAP, Math.max(...shown.map((s) => s.label.length))))
|
|
43
|
+
: 0;
|
|
44
|
+
return jsxs(Box, {
|
|
45
|
+
flexDirection: "column",
|
|
46
|
+
children: [
|
|
47
|
+
jsxs(Box, {
|
|
48
|
+
borderStyle: "round",
|
|
49
|
+
borderColor,
|
|
50
|
+
paddingX: 1,
|
|
51
|
+
children: [
|
|
52
|
+
jsxs(Box, {
|
|
53
|
+
flexGrow: 1,
|
|
54
|
+
children: [
|
|
55
|
+
jsx(Text, { children: theme.color("customMessage", PROMPT_GLYPH) }),
|
|
56
|
+
bufferWithCaret(buffer, caret)
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
jsx(Text, { children: theme.dim("↵ send") })
|
|
60
|
+
]
|
|
61
|
+
}),
|
|
62
|
+
shown.length > 0
|
|
63
|
+
? jsx(Box, {
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
marginTop: 1,
|
|
66
|
+
children: shown.map((suggestion, index) => {
|
|
67
|
+
const active = index === highlight;
|
|
68
|
+
const name = clampName(suggestion.label, nameWidth);
|
|
69
|
+
return jsxs(
|
|
70
|
+
Box,
|
|
71
|
+
{
|
|
72
|
+
children: [
|
|
73
|
+
jsx(Box, {
|
|
74
|
+
width: 2,
|
|
75
|
+
flexShrink: 0,
|
|
76
|
+
children: jsx(Text, { children: active ? theme.color("accent", "▸") : " " })
|
|
77
|
+
}),
|
|
78
|
+
jsx(Box, {
|
|
79
|
+
width: nameWidth,
|
|
80
|
+
flexShrink: 0,
|
|
81
|
+
children: jsx(Text, { bold: active, children: theme.color("customMessage", name) })
|
|
82
|
+
}),
|
|
83
|
+
jsx(Text, { children: " " }),
|
|
84
|
+
jsx(Text, { children: theme.muted(suggestion.detail) })
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
suggestion.value
|
|
88
|
+
);
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
: null
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusBar — the bottom chrome strip of the console.
|
|
3
|
+
*/
|
|
4
|
+
import { Box, Text } from "indusagi/react-host/ink";
|
|
5
|
+
import { Footer, StatusLine, type InkThemeAdapter, type SessionSnapshot, type StatusMessage } from "indusagi/react-ink";
|
|
6
|
+
import { jsx, jsxs } from "indusagi/react-host/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
function permissionBadge(mode: string): { label: string; color: string } {
|
|
9
|
+
switch (mode) {
|
|
10
|
+
case "acceptEdits":
|
|
11
|
+
return { label: "accept-edits", color: "yellow" };
|
|
12
|
+
case "bypass":
|
|
13
|
+
case "bypassPermissions":
|
|
14
|
+
return { label: "bypass-permissions", color: "red" };
|
|
15
|
+
case "plan":
|
|
16
|
+
return { label: "plan", color: "cyan" };
|
|
17
|
+
case "default":
|
|
18
|
+
default:
|
|
19
|
+
return { label: "default", color: "gray" };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface StatusBarProps {
|
|
24
|
+
readonly theme: InkThemeAdapter;
|
|
25
|
+
readonly snapshot: SessionSnapshot;
|
|
26
|
+
readonly branch: string | null;
|
|
27
|
+
readonly providerCount: number;
|
|
28
|
+
readonly status?: StatusMessage;
|
|
29
|
+
readonly permissionMode?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function StatusBar({ theme, snapshot, branch, providerCount, status, permissionMode }: StatusBarProps) {
|
|
33
|
+
const badge = permissionMode !== void 0 ? permissionBadge(permissionMode) : null;
|
|
34
|
+
return jsxs(Box, {
|
|
35
|
+
flexDirection: "column",
|
|
36
|
+
children: [
|
|
37
|
+
jsx(StatusLine, { theme, snapshot, status, showBusyText: false }),
|
|
38
|
+
badge !== null
|
|
39
|
+
? jsx(Box, {
|
|
40
|
+
children: jsxs(Text, {
|
|
41
|
+
color: badge.color,
|
|
42
|
+
children: ["● permission: ", badge.label]
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
: null,
|
|
46
|
+
jsx(Footer, { theme, branch, snapshot, availableProviderCount: providerCount })
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|