@greppleai/grip 0.1.6 → 0.1.7
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 +19 -0
- package/README.md +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +11 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +172 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +9 -2
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +22 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +21 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/instruction-resource-loader.d.ts +1 -0
- package/dist/core/instruction-resource-loader.d.ts.map +1 -1
- package/dist/core/instruction-resource-loader.js +2 -1
- package/dist/core/instruction-resource-loader.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +30 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +3 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +3 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +26 -23
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/operations.d.ts +6 -0
- package/dist/core/tools/operations.d.ts.map +1 -1
- package/dist/core/tools/operations.js +28 -4
- package/dist/core/tools/operations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +8 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +7 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +25 -23
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +33 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/binary-self-update.d.ts +25 -0
- package/dist/utils/binary-self-update.d.ts.map +1 -0
- package/dist/utils/binary-self-update.js +159 -0
- package/dist/utils/binary-self-update.js.map +1 -0
- package/dist/utils/directory-completions.d.ts +8 -0
- package/dist/utils/directory-completions.d.ts.map +1 -1
- package/dist/utils/directory-completions.js +42 -1
- package/dist/utils/directory-completions.js.map +1 -1
- package/docs/extensions.md +31 -1
- package/docs/sandbox.md +2 -2
- package/docs/sessions.md +1 -1
- package/docs/skills.md +4 -4
- package/docs/usage.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -390,20 +390,6 @@ export class InteractiveMode {
|
|
|
390
390
|
path: command.sourceInfo.path,
|
|
391
391
|
}));
|
|
392
392
|
}
|
|
393
|
-
configureNewCommandAutocomplete(commandsByName) {
|
|
394
|
-
const command = commandsByName.get("new");
|
|
395
|
-
if (!command)
|
|
396
|
-
return;
|
|
397
|
-
command.argumentHint = "[--sandbox]";
|
|
398
|
-
command.getArgumentCompletions = (prefix) => {
|
|
399
|
-
if (prefix.includes(" "))
|
|
400
|
-
return null;
|
|
401
|
-
return fuzzyFilter(["--sandbox"], prefix, (option) => option).map((option) => ({
|
|
402
|
-
value: option,
|
|
403
|
-
label: option,
|
|
404
|
-
}));
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
393
|
createBaseAutocompleteProvider() {
|
|
408
394
|
// Commands without arguments remain selectable after a trailing space (e.g. /quit ).
|
|
409
395
|
const noArgumentCommands = new Set([
|
|
@@ -416,6 +402,7 @@ export class InteractiveMode {
|
|
|
416
402
|
"hotkeys",
|
|
417
403
|
"fork",
|
|
418
404
|
"clone",
|
|
405
|
+
"new",
|
|
419
406
|
"tree",
|
|
420
407
|
"login",
|
|
421
408
|
"logout",
|
|
@@ -431,7 +418,13 @@ export class InteractiveMode {
|
|
|
431
418
|
const cdCommand = slashCommands.find((command) => command.name === "cd");
|
|
432
419
|
if (cdCommand) {
|
|
433
420
|
cdCommand.argumentHint = "<directory>";
|
|
434
|
-
cdCommand.getArgumentCompletions = (prefix) =>
|
|
421
|
+
cdCommand.getArgumentCompletions = (prefix) => {
|
|
422
|
+
if (this.activeSandboxBackendConnected)
|
|
423
|
+
return this.session.getSandboxDirectoryCompletions(prefix);
|
|
424
|
+
return this.session.supportsDirectoryChange()
|
|
425
|
+
? getDirectoryCompletions(prefix, this.activeSession.getCwd())
|
|
426
|
+
: [];
|
|
427
|
+
};
|
|
435
428
|
}
|
|
436
429
|
const choiceCompletions = (choices) => (prefix) => {
|
|
437
430
|
if (prefix.includes(" "))
|
|
@@ -457,7 +450,6 @@ export class InteractiveMode {
|
|
|
457
450
|
command.getArgumentCompletions = choiceCompletions(choices);
|
|
458
451
|
}
|
|
459
452
|
}
|
|
460
|
-
this.configureNewCommandAutocomplete(commandsByName);
|
|
461
453
|
const sandboxCommand = slashCommands.find((command) => command.name === "sandbox");
|
|
462
454
|
if (sandboxCommand) {
|
|
463
455
|
sandboxCommand.argumentHint = "<status|clear|--attach|start|list|stop>";
|
|
@@ -1612,12 +1604,15 @@ export class InteractiveMode {
|
|
|
1612
1604
|
cwd: this.activeSession.getCwd(),
|
|
1613
1605
|
toolOperations: this.session.getToolOperations(),
|
|
1614
1606
|
getToolBackendInfo: () => this.session.getToolBackendInfo(),
|
|
1607
|
+
isSandbox: () => this.session.isSandbox(),
|
|
1615
1608
|
getLspStatus: () => this.session.getLspStatus(),
|
|
1616
1609
|
configureLsp: (configuration) => this.session.configureLsp(configuration),
|
|
1617
1610
|
execToolBackend: (command, options) => {
|
|
1618
1611
|
const operations = this.session.getToolOperations();
|
|
1619
1612
|
return executeBashWithOperations(command, options?.cwd ?? operations.cwd, operations, options);
|
|
1620
1613
|
},
|
|
1614
|
+
execHostCommand: (command, options) => extensionRunner.createContext().execHostCommand(command, options),
|
|
1615
|
+
execHostProcess: (executable, args, options) => extensionRunner.createContext().execHostProcess(executable, args, options),
|
|
1621
1616
|
session: this.activeSession,
|
|
1622
1617
|
modelRegistry: this.session.modelRegistry,
|
|
1623
1618
|
model: this.session.model,
|
|
@@ -1672,7 +1667,7 @@ export class InteractiveMode {
|
|
|
1672
1667
|
return theme.fg("dim", `tools: local ${info.cwd}`);
|
|
1673
1668
|
}
|
|
1674
1669
|
return info.configured
|
|
1675
|
-
? theme.fg("accent", `tools: remote ${info.url} ${info.cwd}`)
|
|
1670
|
+
? theme.fg("accent", `tools: remote ${info.url} ${this.activeSandboxBackendConnected ? this.session.getToolOperations().cwd : info.cwd}`)
|
|
1676
1671
|
: theme.fg("warning", `tools: remote not configured ${info.cwd}`);
|
|
1677
1672
|
}
|
|
1678
1673
|
updateToolBackendStatus() {
|
|
@@ -2543,11 +2538,11 @@ export class InteractiveMode {
|
|
|
2543
2538
|
run: async () => {
|
|
2544
2539
|
this.editor.setText("");
|
|
2545
2540
|
const option = text.slice("/new".length).trim();
|
|
2546
|
-
if (option
|
|
2547
|
-
this.showWarning("Usage: /new
|
|
2541
|
+
if (option) {
|
|
2542
|
+
this.showWarning("Usage: /new");
|
|
2548
2543
|
return;
|
|
2549
2544
|
}
|
|
2550
|
-
await this.handleClearCommand(
|
|
2545
|
+
await this.handleClearCommand();
|
|
2551
2546
|
},
|
|
2552
2547
|
};
|
|
2553
2548
|
}
|
|
@@ -4948,10 +4943,14 @@ export class InteractiveMode {
|
|
|
4948
4943
|
}
|
|
4949
4944
|
try {
|
|
4950
4945
|
const directory = await this.session.changeSandboxWorkingDirectory(argument ?? backend.workspace.root);
|
|
4946
|
+
this.updateToolBackendStatus();
|
|
4951
4947
|
this.showStatus(`Working directory: ${directory}`);
|
|
4952
4948
|
}
|
|
4953
4949
|
catch (error) {
|
|
4954
|
-
|
|
4950
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
4951
|
+
this.showError(message === "Remote workspace request handler failed"
|
|
4952
|
+
? `Directory unavailable in sandbox: ${argument ?? backend.workspace.root} (it must exist within the mounted workspace ${backend.workspace.root})`
|
|
4953
|
+
: `Failed to change sandbox directory: ${message}`);
|
|
4955
4954
|
}
|
|
4956
4955
|
}
|
|
4957
4956
|
async handleUnavailableCdCommand(text) {
|
|
@@ -5385,6 +5384,7 @@ export class InteractiveMode {
|
|
|
5385
5384
|
try {
|
|
5386
5385
|
await this.session.activateSandboxDaemon({
|
|
5387
5386
|
url: state.url,
|
|
5387
|
+
hostWorkspaceRoot: state.hostWorkspaceRoot,
|
|
5388
5388
|
token: state.token,
|
|
5389
5389
|
expectedCwd: state.expectedCwd,
|
|
5390
5390
|
});
|
|
@@ -5466,6 +5466,7 @@ export class InteractiveMode {
|
|
|
5466
5466
|
url: result.daemonUrl,
|
|
5467
5467
|
token: result.token,
|
|
5468
5468
|
expectedCwd: result.workspaceMountPath,
|
|
5469
|
+
hostWorkspaceRoot: result.workspaceRoot,
|
|
5469
5470
|
});
|
|
5470
5471
|
break;
|
|
5471
5472
|
}
|
|
@@ -5522,6 +5523,7 @@ export class InteractiveMode {
|
|
|
5522
5523
|
url: result.daemonUrl,
|
|
5523
5524
|
token: result.token,
|
|
5524
5525
|
expectedCwd: result.workspaceMountPath,
|
|
5526
|
+
hostWorkspaceRoot: result.workspaceRoot,
|
|
5525
5527
|
containerId: result.containerId,
|
|
5526
5528
|
});
|
|
5527
5529
|
this.refreshUiAfterBackendChange();
|
|
@@ -5831,13 +5833,13 @@ export class InteractiveMode {
|
|
|
5831
5833
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5832
5834
|
this.ui.requestRender();
|
|
5833
5835
|
}
|
|
5834
|
-
async handleClearCommand(
|
|
5836
|
+
async handleClearCommand() {
|
|
5835
5837
|
if (this.loadingAnimation) {
|
|
5836
5838
|
this.loadingAnimation.stop();
|
|
5837
5839
|
this.loadingAnimation = undefined;
|
|
5838
5840
|
}
|
|
5839
5841
|
this.statusContainer.clear();
|
|
5840
|
-
const sandboxState =
|
|
5842
|
+
const sandboxState = this.activeSandboxBackendConnected
|
|
5841
5843
|
? this.sessionSandboxStates.get(getSessionSandboxKey(this.activeSession))
|
|
5842
5844
|
: undefined;
|
|
5843
5845
|
let newSessionKey;
|