@superjackfruitlabs/salaam 0.0.4 → 0.0.5
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 +41 -0
- package/dist/src/acp-desk.js +140 -0
- package/dist/src/acp-outcome.js +23 -19
- package/dist/src/acp.js +258 -11
- package/dist/src/approval-rules.js +287 -0
- package/dist/src/attach.js +3 -1
- package/dist/src/autonomy.js +80 -9
- package/dist/src/cli-help.js +34 -4
- package/dist/src/cli.js +55 -3
- package/dist/src/command-danger.js +797 -0
- package/dist/src/command-sandbox.js +116 -6
- package/dist/src/custom-commands.js +159 -0
- package/dist/src/danger-classifier.js +286 -0
- package/dist/src/git-helpers.js +160 -0
- package/dist/src/hooks.js +351 -0
- package/dist/src/host.js +96 -4
- package/dist/src/house-extension.js +133 -7
- package/dist/src/local-coding.js +553 -58
- package/dist/src/local-edits.js +168 -6
- package/dist/src/mentions.js +277 -0
- package/dist/src/pi-sessions.js +5 -1
- package/dist/src/project-instructions.js +195 -0
- package/dist/src/protocol.js +4 -1
- package/dist/src/service.js +342 -5
- package/dist/src/session-pick.js +77 -0
- package/dist/src/shell-passthrough.js +39 -0
- package/dist/src/store.js +51 -4
- package/dist/src/supervisor.js +233 -22
- package/dist/src/task-context.js +8 -2
- package/dist/src/terminal-status.js +88 -0
- package/dist/src/tui-activity.js +99 -0
- package/dist/src/tui-classifier.js +25 -0
- package/dist/src/tui-client.js +186 -5
- package/dist/src/tui-commands.js +23 -5
- package/dist/src/tui-composer.js +113 -0
- package/dist/src/tui-keymap.js +116 -0
- package/dist/src/tui-mentions.js +38 -0
- package/dist/src/tui-modals.js +157 -34
- package/dist/src/tui-notify.js +62 -0
- package/dist/src/tui-review.js +55 -0
- package/dist/src/tui-turn-keys.js +52 -0
- package/dist/src/tui-view.js +243 -69
- package/dist/src/tui.js +875 -118
- package/dist/src/turn-checkpoints.js +221 -0
- package/dist/src/turn-rewind.js +168 -0
- package/dist/src/web-fetch.js +114 -0
- package/dist/src/web-guard.js +163 -0
- package/dist/src/web-search.js +302 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/acp-desk.ts +155 -0
- package/src/acp-outcome.ts +25 -21
- package/src/acp.ts +338 -28
- package/src/approval-rules.ts +360 -0
- package/src/attach.ts +4 -1
- package/src/autonomy.ts +111 -10
- package/src/cli-help.ts +33 -4
- package/src/cli.ts +66 -2
- package/src/command-danger.ts +886 -0
- package/src/command-sandbox.ts +128 -8
- package/src/custom-commands.ts +175 -0
- package/src/danger-classifier.ts +321 -0
- package/src/git-helpers.ts +177 -0
- package/src/hooks.ts +425 -0
- package/src/host.ts +122 -1
- package/src/house-extension.ts +142 -7
- package/src/local-coding.ts +674 -75
- package/src/local-edits.ts +191 -8
- package/src/mentions.ts +304 -0
- package/src/pi-sessions.ts +9 -1
- package/src/project-instructions.ts +229 -0
- package/src/protocol.ts +19 -2
- package/src/service.ts +488 -5
- package/src/session-pick.ts +102 -0
- package/src/shell-passthrough.ts +38 -0
- package/src/store.ts +52 -3
- package/src/supervisor.ts +262 -24
- package/src/task-context.ts +9 -2
- package/src/terminal-status.ts +103 -0
- package/src/tui-activity.ts +133 -0
- package/src/tui-classifier.ts +38 -0
- package/src/tui-client.ts +239 -8
- package/src/tui-commands.ts +49 -10
- package/src/tui-composer.ts +124 -0
- package/src/tui-keymap.ts +152 -0
- package/src/tui-mentions.ts +43 -0
- package/src/tui-modals.ts +173 -43
- package/src/tui-notify.ts +77 -0
- package/src/tui-review.ts +76 -0
- package/src/tui-turn-keys.ts +77 -0
- package/src/tui-view.ts +341 -88
- package/src/tui.ts +1047 -137
- package/src/turn-checkpoints.ts +253 -0
- package/src/turn-rewind.ts +258 -0
- package/src/web-fetch.ts +140 -0
- package/src/web-guard.ts +195 -0
- package/src/web-search.ts +402 -0
package/src/cli.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { loadDangerClassifierOptions } from './danger-classifier.js';
|
|
3
|
+
import { loadWebSearchConfig } from './web-search.js';
|
|
2
4
|
import { SANDBOX_LEVELS, type SandboxLevel } from './command-sandbox.js';
|
|
3
5
|
import { acp } from './acp.js';
|
|
4
6
|
import { homedir } from 'node:os';
|
|
@@ -67,6 +69,10 @@ async function main(): Promise<void> {
|
|
|
67
69
|
console.log('salaam ' + VERSION);
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
72
|
+
if (args[0] === '-c' || args[0] === '--continue') {
|
|
73
|
+
const { continueArgs } = await import('./session-pick.js');
|
|
74
|
+
args.splice(0, args.length, ...continueArgs(args)!);
|
|
75
|
+
}
|
|
70
76
|
if (args[0] === 'mcp') {
|
|
71
77
|
// Parsed before global help: a declared command's own flags follow "--".
|
|
72
78
|
const rest = args.slice(1);
|
|
@@ -517,7 +523,11 @@ async function main(): Promise<void> {
|
|
|
517
523
|
hostToolsUser,
|
|
518
524
|
hostApprovalTtlMs,
|
|
519
525
|
hostAllowsUnsandboxed,
|
|
526
|
+
hostAllowsFullAccessSessions,
|
|
527
|
+
hostAllowsYoloSessions,
|
|
528
|
+
hostDangerClassifier,
|
|
520
529
|
hostCommandNetwork,
|
|
530
|
+
hostReadPaths,
|
|
521
531
|
} = await import('./host.js');
|
|
522
532
|
if (verb?.startsWith('config-')) {
|
|
523
533
|
const file = option('--manifest');
|
|
@@ -661,7 +671,18 @@ async function main(): Promise<void> {
|
|
|
661
671
|
providerRoute: m.provider,
|
|
662
672
|
approvalTtlMs: hostApprovalTtlMs(m),
|
|
663
673
|
...(hostAllowsUnsandboxed(m) ? { unsandboxedCommands: 'allow' as const } : {}),
|
|
674
|
+
// A host session may choose full access only when the reviewed manifest says so.
|
|
675
|
+
allowFullAccessSessions: hostAllowsFullAccessSessions(m),
|
|
676
|
+
allowYoloSessions: hostAllowsYoloSessions(m),
|
|
677
|
+
// The command reviewer only as the reviewed manifest names it (forbidden when absent).
|
|
678
|
+
...(hostDangerClassifier(m).config
|
|
679
|
+
? { dangerClassifierConfig: hostDangerClassifier(m).config }
|
|
680
|
+
: {}),
|
|
681
|
+
...(hostDangerClassifier(m).pin
|
|
682
|
+
? { dangerClassifierPin: hostDangerClassifier(m).pin }
|
|
683
|
+
: {}),
|
|
664
684
|
...(hostCommandNetwork(m) ? { commandNetwork: hostCommandNetwork(m)! } : {}),
|
|
685
|
+
...(hostReadPaths(m).length ? { localSandboxReadPaths: hostReadPaths(m) } : {}),
|
|
665
686
|
});
|
|
666
687
|
if (process.connected) process.once('disconnect', () => void service.close());
|
|
667
688
|
for (const signal of ['SIGTERM', 'SIGINT'] as const)
|
|
@@ -688,6 +709,20 @@ async function main(): Promise<void> {
|
|
|
688
709
|
});
|
|
689
710
|
return;
|
|
690
711
|
}
|
|
712
|
+
if (group === 'code' || group === 'here') {
|
|
713
|
+
const { parseCodeStart } = await import('./session-pick.js');
|
|
714
|
+
const start = parseCodeStart(args.slice(1));
|
|
715
|
+
const { tui } = await import('./tui.js');
|
|
716
|
+
await tui({
|
|
717
|
+
state,
|
|
718
|
+
start,
|
|
719
|
+
cwd: option('--cwd'),
|
|
720
|
+
takeover: args.includes('--takeover'),
|
|
721
|
+
codingRoot: option('--coding-root'),
|
|
722
|
+
codingSocket: option('--coding-socket'),
|
|
723
|
+
});
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
691
726
|
if (
|
|
692
727
|
!group ||
|
|
693
728
|
group === 'tui' ||
|
|
@@ -841,7 +876,7 @@ async function main(): Promise<void> {
|
|
|
841
876
|
return;
|
|
842
877
|
}
|
|
843
878
|
if (group === 'acp') {
|
|
844
|
-
await acp(state, { coding: args.includes('--coding') });
|
|
879
|
+
await acp(state, { coding: args.includes('--coding'), local: args.includes('--local') });
|
|
845
880
|
return;
|
|
846
881
|
}
|
|
847
882
|
if (group === 'providers' && verb === 'list') {
|
|
@@ -1634,7 +1669,26 @@ async function main(): Promise<void> {
|
|
|
1634
1669
|
toolsUser = option('--tools-user') ?? (process.env.SALAAM_TOOLS_USER || undefined),
|
|
1635
1670
|
localSandbox = option('--local-sandbox') ?? (process.env.SALAAM_LOCAL_SANDBOX || undefined),
|
|
1636
1671
|
unsandboxedCommands =
|
|
1637
|
-
option('--unsandboxed-commands') ?? (process.env.SALAAM_UNSANDBOXED_COMMANDS || undefined)
|
|
1672
|
+
option('--unsandboxed-commands') ?? (process.env.SALAAM_UNSANDBOXED_COMMANDS || undefined),
|
|
1673
|
+
localSandboxRead = (
|
|
1674
|
+
option('--local-sandbox-read') ??
|
|
1675
|
+
(process.env.SALAAM_LOCAL_SANDBOX_READ || '')
|
|
1676
|
+
)
|
|
1677
|
+
.split(',')
|
|
1678
|
+
.map((p) => p.trim())
|
|
1679
|
+
.filter(Boolean),
|
|
1680
|
+
webSearchConfig =
|
|
1681
|
+
option('--web-search-config') ?? (process.env.SALAAM_WEB_SEARCH_CONFIG || undefined),
|
|
1682
|
+
dangerClassifierConfig =
|
|
1683
|
+
option('--danger-classifier-config') ??
|
|
1684
|
+
(process.env.SALAAM_DANGER_CLASSIFIER_CONFIG || undefined);
|
|
1685
|
+
// Fail early on a bad command-reviewer config; its key is read from the named variable, never printed.
|
|
1686
|
+
if (dangerClassifierConfig)
|
|
1687
|
+
loadDangerClassifierOptions(
|
|
1688
|
+
JSON.parse(readFileSync(resolve(dangerClassifierConfig), 'utf8')),
|
|
1689
|
+
);
|
|
1690
|
+
// Fail early on a bad web search config; its keys are read, never printed.
|
|
1691
|
+
if (webSearchConfig) loadWebSearchConfig(resolve(webSearchConfig));
|
|
1638
1692
|
if (localSandbox !== undefined && !(SANDBOX_LEVELS as readonly string[]).includes(localSandbox))
|
|
1639
1693
|
throw Error('--local-sandbox is read-only, workspace-write or full-access');
|
|
1640
1694
|
if (unsandboxedCommands !== undefined && unsandboxedCommands !== 'allow')
|
|
@@ -1653,6 +1707,11 @@ async function main(): Promise<void> {
|
|
|
1653
1707
|
toolsUser,
|
|
1654
1708
|
...(localSandbox ? { localSandbox: localSandbox as SandboxLevel } : {}),
|
|
1655
1709
|
...(unsandboxedCommands ? { unsandboxedCommands: 'allow' as const } : {}),
|
|
1710
|
+
...(localSandboxRead.length ? { localSandboxReadPaths: localSandboxRead } : {}),
|
|
1711
|
+
...(webSearchConfig ? { webSearchConfig: resolve(webSearchConfig) } : {}),
|
|
1712
|
+
...(dangerClassifierConfig
|
|
1713
|
+
? { dangerClassifierConfig: resolve(dangerClassifierConfig) }
|
|
1714
|
+
: {}),
|
|
1656
1715
|
effectConnector: effectSocket
|
|
1657
1716
|
? new SocketEffectConnector(resolve(effectSocket), { opaque })
|
|
1658
1717
|
: undefined,
|
|
@@ -1746,6 +1805,11 @@ async function main(): Promise<void> {
|
|
|
1746
1805
|
...(toolsUser ? ['--tools-user', toolsUser] : []),
|
|
1747
1806
|
...(localSandbox ? ['--local-sandbox', localSandbox] : []),
|
|
1748
1807
|
...(unsandboxedCommands ? ['--unsandboxed-commands', 'allow'] : []),
|
|
1808
|
+
...(localSandboxRead.length ? ['--local-sandbox-read', localSandboxRead.join(',')] : []),
|
|
1809
|
+
...(webSearchConfig ? ['--web-search-config', resolve(webSearchConfig)] : []),
|
|
1810
|
+
...(dangerClassifierConfig
|
|
1811
|
+
? ['--danger-classifier-config', resolve(dangerClassifierConfig)]
|
|
1812
|
+
: []),
|
|
1749
1813
|
],
|
|
1750
1814
|
{ detached: true, stdio: ['ignore', fd, fd] },
|
|
1751
1815
|
);
|