@robota-sdk/agent-command 3.0.0-beta.72 → 3.0.0-beta.74
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/dist/node/index.cjs +34 -34
- package/dist/node/index.d.ts +40 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +33 -33
- package/dist/node/index.js.map +1 -1
- package/package.json +9 -8
- package/src/agent/agent-command-module.ts +1 -2
- package/src/agent/agent-command-parser.ts +1 -1
- package/src/agent/agent-command.ts +2 -5
- package/src/background/background-command-module.ts +2 -6
- package/src/background/background-command.ts +2 -1
- package/src/compact/compact-command-module.ts +2 -6
- package/src/compact/compact-command.ts +2 -1
- package/src/context/__tests__/context-command-module.test.ts +2 -2
- package/src/context/context-command-module.ts +2 -6
- package/src/context/context-command.ts +1 -2
- package/src/default/default-command-modules.ts +2 -0
- package/src/exit/exit-command-module.ts +2 -3
- package/src/exit/exit-command.ts +2 -1
- package/src/help/__tests__/help-command.test.ts +2 -5
- package/src/help/help-command-module.ts +2 -6
- package/src/help/help-command.ts +2 -1
- package/src/index.ts +1 -0
- package/src/language/language-command-module.ts +2 -3
- package/src/language/language-command.ts +2 -1
- package/src/memory/memory-command-module.ts +2 -6
- package/src/memory/memory-command.ts +1 -2
- package/src/mode/__tests__/mode-command-module.test.ts +1 -1
- package/src/mode/mode-command-module.ts +2 -3
- package/src/mode/mode-command.ts +2 -1
- package/src/permissions/__tests__/permissions-command-module.test.ts +1 -1
- package/src/permissions/permissions-command-module.ts +2 -6
- package/src/permissions/permissions-command.ts +2 -1
- package/src/plugin/__tests__/plugin-command-module.test.ts +2 -5
- package/src/plugin/plugin-command-module.ts +2 -6
- package/src/plugin/plugin-command.ts +2 -5
- package/src/plugins/default-plugin-command-adapter.ts +2 -2
- package/src/provider/provider-command-execution.ts +1 -2
- package/src/provider/provider-command-module.ts +5 -3
- package/src/provider/provider-command-profile-lifecycle.ts +2 -5
- package/src/provider/provider-command-profile-operations.ts +2 -3
- package/src/provider/provider-command-profile.ts +1 -2
- package/src/provider/provider-command-setup.ts +7 -5
- package/src/provider/provider-startup.ts +14 -2
- package/src/reset/reset-command-module.ts +2 -6
- package/src/reset/reset-command.ts +2 -1
- package/src/rewind/rewind-command-module.ts +2 -6
- package/src/rewind/rewind-command.ts +1 -1
- package/src/schedule/__tests__/schedule-command.test.ts +107 -0
- package/src/schedule/index.ts +9 -0
- package/src/schedule/schedule-command-module.ts +102 -0
- package/src/schedule/schedule-command.ts +72 -0
- package/src/schedule/schedule-spec-parser.ts +66 -0
- package/src/session/session-command-module.ts +2 -3
- package/src/session/session-command.ts +2 -1
- package/src/settings/settings-command-module.ts +2 -6
- package/src/skills/skills-command-module.ts +2 -6
- package/src/skills/skills-command.ts +2 -5
- package/src/statusline/statusline-command-module.ts +2 -6
- package/src/statusline/statusline-command.ts +2 -2
- package/src/user-local/user-local-command-module.ts +2 -6
- package/src/user-local/user-local-command.ts +2 -1
- package/src/user-local/user-local-memory-command.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robota-sdk/agent-command",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.74",
|
|
4
4
|
"description": "Consolidated command module implementations for Robota SDK CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.js",
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@robota-sdk/agent-core": "3.0.0-beta.
|
|
28
|
-
"@robota-sdk/agent-framework": "3.0.0-beta.
|
|
27
|
+
"@robota-sdk/agent-core": "3.0.0-beta.74",
|
|
28
|
+
"@robota-sdk/agent-framework": "3.0.0-beta.74",
|
|
29
|
+
"@robota-sdk/agent-interface-transport": "3.0.0-beta.74"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^22.
|
|
32
|
-
"rimraf": "^6.
|
|
33
|
-
"tsdown": "^0.22.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"vitest": "^
|
|
32
|
+
"@types/node": "^22.19.21",
|
|
33
|
+
"rimraf": "^6.1.3",
|
|
34
|
+
"tsdown": "^0.22.2",
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"vitest": "^3.2.6"
|
|
36
37
|
},
|
|
37
38
|
"license": "MIT",
|
|
38
39
|
"publishConfig": {
|
|
@@ -2,12 +2,11 @@ import { executeAgentCommand } from './agent-command.js';
|
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
IAgentJobHostContext,
|
|
5
|
-
ICommand,
|
|
6
5
|
ICommandHostContext,
|
|
7
6
|
ICommandModule,
|
|
8
|
-
ICommandSource,
|
|
9
7
|
ISystemCommand,
|
|
10
8
|
} from '@robota-sdk/agent-framework';
|
|
9
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
11
10
|
|
|
12
11
|
function getAgentHostContext(context: ICommandHostContext): IAgentJobHostContext {
|
|
13
12
|
const cap = context.getAgentJobCapability?.();
|
|
@@ -3,11 +3,8 @@ import { summarizeBackgroundJobGroup } from '@robota-sdk/agent-framework';
|
|
|
3
3
|
import { parseParallelRequests, parseRunRequest, tokenizeArgs } from './agent-command-parser.js';
|
|
4
4
|
|
|
5
5
|
import type { IAgentRunRequest } from './agent-command-parser.js';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
ICommandResult,
|
|
9
|
-
ISubagentJobState,
|
|
10
|
-
} from '@robota-sdk/agent-framework';
|
|
6
|
+
import type { IAgentJobHostContext, ISubagentJobState } from '@robota-sdk/agent-framework';
|
|
7
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
11
8
|
|
|
12
9
|
function formatError<TError>(error: TError): string {
|
|
13
10
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -5,12 +5,8 @@ import {
|
|
|
5
5
|
|
|
6
6
|
import { executeBackgroundCommand } from './background-command.js';
|
|
7
7
|
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
ICommandModule,
|
|
11
|
-
ICommandSource,
|
|
12
|
-
ISystemCommand,
|
|
13
|
-
} from '@robota-sdk/agent-framework';
|
|
8
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
9
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
14
10
|
|
|
15
11
|
export function createBackgroundCommandEntry(): ICommand {
|
|
16
12
|
return {
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
readCommandBackgroundTaskLog,
|
|
9
9
|
} from '@robota-sdk/agent-framework';
|
|
10
10
|
|
|
11
|
-
import type { ICommandHostContext
|
|
11
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
12
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
12
13
|
|
|
13
14
|
function parseCommandParts(args: string): string[] {
|
|
14
15
|
return args.trim().split(/\s+/).filter(Boolean);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { executeCompactCommand } from './compact-command.js';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
ICommandModule,
|
|
6
|
-
ICommandSource,
|
|
7
|
-
ISystemCommand,
|
|
8
|
-
} from '@robota-sdk/agent-framework';
|
|
3
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
9
5
|
|
|
10
6
|
export function createCompactCommandEntry(): ICommand {
|
|
11
7
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { compactCommandContext } from '@robota-sdk/agent-framework';
|
|
2
2
|
|
|
3
|
-
import type { ICommandHostContext
|
|
3
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
4
5
|
|
|
5
6
|
function parseInstructions(args: string): string | undefined {
|
|
6
7
|
const instructions = args.trim();
|
|
@@ -2,13 +2,13 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
2
2
|
import type { IHistoryEntry } from '@robota-sdk/agent-core';
|
|
3
3
|
import type {
|
|
4
4
|
ICommandHostContext,
|
|
5
|
+
ICommandSessionRuntime,
|
|
5
6
|
IContextReferenceAddResult,
|
|
6
7
|
IContextReferenceClearResult,
|
|
7
|
-
IContextReferenceItem,
|
|
8
8
|
IContextReferenceRemoveResult,
|
|
9
|
-
ICommandSessionRuntime,
|
|
10
9
|
TAutoCompactThresholdSource,
|
|
11
10
|
} from '@robota-sdk/agent-framework';
|
|
11
|
+
import type { IContextReferenceItem } from '@robota-sdk/agent-interface-transport';
|
|
12
12
|
import { SystemCommandExecutor } from '@robota-sdk/agent-framework';
|
|
13
13
|
import { createContextCommandModule } from '../context-command-module.js';
|
|
14
14
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { executeContextCommand } from './context-command.js';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
ICommandModule,
|
|
6
|
-
ICommandSource,
|
|
7
|
-
ISystemCommand,
|
|
8
|
-
} from '@robota-sdk/agent-framework';
|
|
3
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
9
5
|
|
|
10
6
|
export function createContextCommandEntry(): ICommand {
|
|
11
7
|
return {
|
|
@@ -15,11 +15,10 @@ import {
|
|
|
15
15
|
import type { IHistoryEntry, TUniversalMessage } from '@robota-sdk/agent-core';
|
|
16
16
|
import type {
|
|
17
17
|
ICommandHostContext,
|
|
18
|
-
ICommandResult,
|
|
19
18
|
TAutoCompactThreshold,
|
|
20
19
|
TAutoCompactThresholdSource,
|
|
21
20
|
} from '@robota-sdk/agent-framework';
|
|
22
|
-
import type { IContextReferenceItem } from '@robota-sdk/agent-
|
|
21
|
+
import type { ICommandResult, IContextReferenceItem } from '@robota-sdk/agent-interface-transport';
|
|
23
22
|
|
|
24
23
|
const PERCENT = 100;
|
|
25
24
|
const USAGE = [
|
|
@@ -12,6 +12,7 @@ import { createPluginCommandModule } from '../plugin/index.js';
|
|
|
12
12
|
import { createProviderCommandModule } from '../provider/index.js';
|
|
13
13
|
import { createResetCommandModule } from '../reset/index.js';
|
|
14
14
|
import { createRewindCommandModule } from '../rewind/index.js';
|
|
15
|
+
import { createScheduleCommandModule } from '../schedule/index.js';
|
|
15
16
|
import { createSessionCommandModule } from '../session/index.js';
|
|
16
17
|
import { createSettingsCommandModule } from '../settings/index.js';
|
|
17
18
|
import { createSkillsCommandModule } from '../skills/index.js';
|
|
@@ -48,6 +49,7 @@ export function createDefaultCommandModules({
|
|
|
48
49
|
createSessionCommandModule(),
|
|
49
50
|
createResetCommandModule(),
|
|
50
51
|
createRewindCommandModule(),
|
|
52
|
+
createScheduleCommandModule(),
|
|
51
53
|
createStatusLineCommandModule(),
|
|
52
54
|
createPluginCommandModule(),
|
|
53
55
|
createSettingsCommandModule(),
|
|
@@ -2,13 +2,12 @@ import { EXIT_COMMAND_DESCRIPTION } from '@robota-sdk/agent-framework';
|
|
|
2
2
|
|
|
3
3
|
import { executeExitCommand } from './exit-command.js';
|
|
4
4
|
|
|
5
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
5
6
|
import type {
|
|
6
7
|
ICommand,
|
|
7
8
|
ICommandInteractionHint,
|
|
8
|
-
ICommandModule,
|
|
9
9
|
ICommandSource,
|
|
10
|
-
|
|
11
|
-
} from '@robota-sdk/agent-framework';
|
|
10
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
12
11
|
|
|
13
12
|
export function createExitCommandEntry(): ICommand {
|
|
14
13
|
return {
|
package/src/exit/exit-command.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createSessionExitRequestedEffect } from '@robota-sdk/agent-framework';
|
|
2
2
|
|
|
3
|
-
import type { ICommandHostContext
|
|
3
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
4
5
|
|
|
5
6
|
export function executeExitCommand(_context: ICommandHostContext, _args: string): ICommandResult {
|
|
6
7
|
return {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
ICommandListEntry,
|
|
4
|
-
ICommandSessionRuntime,
|
|
5
|
-
} from '@robota-sdk/agent-framework';
|
|
1
|
+
import type { ICommandHostContext, ICommandSessionRuntime } from '@robota-sdk/agent-framework';
|
|
2
|
+
import type { ICommandListEntry } from '@robota-sdk/agent-interface-transport';
|
|
6
3
|
import { formatCommandHelpMessage } from '@robota-sdk/agent-framework';
|
|
7
4
|
import { describe, expect, it } from 'vitest';
|
|
8
5
|
|
|
@@ -2,12 +2,8 @@ import { HELP_COMMAND_DESCRIPTION } from '@robota-sdk/agent-framework';
|
|
|
2
2
|
|
|
3
3
|
import { executeHelpCommand } from './help-command.js';
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
ICommandModule,
|
|
8
|
-
ICommandSource,
|
|
9
|
-
ISystemCommand,
|
|
10
|
-
} from '@robota-sdk/agent-framework';
|
|
5
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
6
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
11
7
|
|
|
12
8
|
export function createHelpCommandEntry(): ICommand {
|
|
13
9
|
return {
|
package/src/help/help-command.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formatCommandHelpMessage } from '@robota-sdk/agent-framework';
|
|
2
2
|
|
|
3
|
-
import type { ICommandHostContext
|
|
3
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
4
5
|
|
|
5
6
|
export function executeHelpCommand(context: ICommandHostContext, _args: string): ICommandResult {
|
|
6
7
|
return {
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './plugin/index.js';
|
|
|
13
13
|
export * from './provider/index.js';
|
|
14
14
|
export * from './reset/index.js';
|
|
15
15
|
export * from './rewind/index.js';
|
|
16
|
+
export * from './schedule/index.js';
|
|
16
17
|
export * from './session/index.js';
|
|
17
18
|
export * from './settings/index.js';
|
|
18
19
|
export * from './skills/index.js';
|
|
@@ -6,13 +6,12 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { executeLanguageCommand } from './language-command.js';
|
|
8
8
|
|
|
9
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
9
10
|
import type {
|
|
10
11
|
ICommand,
|
|
11
12
|
ICommandInteractionHint,
|
|
12
|
-
ICommandModule,
|
|
13
13
|
ICommandSource,
|
|
14
|
-
|
|
15
|
-
} from '@robota-sdk/agent-framework';
|
|
14
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
16
15
|
|
|
17
16
|
export function createLanguageCommandEntry(): ICommand {
|
|
18
17
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formatLanguageUsageMessage, parseLanguageArgument } from '@robota-sdk/agent-framework';
|
|
2
2
|
|
|
3
|
-
import type { ICommandHostContext
|
|
3
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
4
5
|
|
|
5
6
|
export function executeLanguageCommand(
|
|
6
7
|
_context: ICommandHostContext,
|
|
@@ -6,12 +6,8 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { executeMemoryCommand } from './memory-command.js';
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
ICommandModule,
|
|
12
|
-
ICommandSource,
|
|
13
|
-
ISystemCommand,
|
|
14
|
-
} from '@robota-sdk/agent-framework';
|
|
9
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
10
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
15
11
|
|
|
16
12
|
export function createMemoryCommandEntry(): ICommand {
|
|
17
13
|
return {
|
|
@@ -12,9 +12,8 @@ import type {
|
|
|
12
12
|
ICommandHostContext,
|
|
13
13
|
ICommandPendingMemoryStore,
|
|
14
14
|
ICommandProjectMemoryStore,
|
|
15
|
-
ICommandResult,
|
|
16
|
-
IMemoryEvent,
|
|
17
15
|
} from '@robota-sdk/agent-framework';
|
|
16
|
+
import type { ICommandResult, IMemoryEvent } from '@robota-sdk/agent-interface-transport';
|
|
18
17
|
|
|
19
18
|
const SUBCOMMAND_INDEX = 0;
|
|
20
19
|
const TYPE_INDEX = 1;
|
|
@@ -7,7 +7,7 @@ import { SystemCommandExecutor } from '@robota-sdk/agent-framework';
|
|
|
7
7
|
import { createModeCommandModule } from '../mode-command-module.js';
|
|
8
8
|
|
|
9
9
|
type TPermissionModeName = 'plan' | 'default' | 'acceptEdits' | 'bypassPermissions';
|
|
10
|
-
type TSetPermissionModeSpy = ReturnType<typeof vi.fn<
|
|
10
|
+
type TSetPermissionModeSpy = ReturnType<typeof vi.fn<(nextMode: TPermissionModeName) => void>>;
|
|
11
11
|
|
|
12
12
|
function createCheckpointResult(): IEditCheckpointRestoreResult {
|
|
13
13
|
return {
|
|
@@ -6,13 +6,12 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { executeModeCommand } from './mode-command.js';
|
|
8
8
|
|
|
9
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
9
10
|
import type {
|
|
10
11
|
ICommand,
|
|
11
12
|
ICommandInteractionHint,
|
|
12
|
-
ICommandModule,
|
|
13
13
|
ICommandSource,
|
|
14
|
-
|
|
15
|
-
} from '@robota-sdk/agent-framework';
|
|
14
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
16
15
|
|
|
17
16
|
export function createModeCommandEntry(): ICommand {
|
|
18
17
|
return {
|
package/src/mode/mode-command.ts
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
writeCommandPermissionMode,
|
|
7
7
|
} from '@robota-sdk/agent-framework';
|
|
8
8
|
|
|
9
|
-
import type { ICommandHostContext
|
|
9
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
10
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
10
11
|
|
|
11
12
|
export function executeModeCommand(context: ICommandHostContext, args: string): ICommandResult {
|
|
12
13
|
const arg = parsePermissionModeArgument(args);
|
|
@@ -7,7 +7,7 @@ import { SystemCommandExecutor } from '@robota-sdk/agent-framework';
|
|
|
7
7
|
import { createPermissionsCommandModule } from '../permissions-command-module.js';
|
|
8
8
|
|
|
9
9
|
type TPermissionModeName = 'plan' | 'default' | 'acceptEdits' | 'bypassPermissions';
|
|
10
|
-
type TSetPermissionModeSpy = ReturnType<typeof vi.fn<
|
|
10
|
+
type TSetPermissionModeSpy = ReturnType<typeof vi.fn<(nextMode: TPermissionModeName) => void>>;
|
|
11
11
|
|
|
12
12
|
function createCheckpointResult(): IEditCheckpointRestoreResult {
|
|
13
13
|
return {
|
|
@@ -6,12 +6,8 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { executePermissionsCommand } from './permissions-command.js';
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
ICommandModule,
|
|
12
|
-
ICommandSource,
|
|
13
|
-
ISystemCommand,
|
|
14
|
-
} from '@robota-sdk/agent-framework';
|
|
9
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
10
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
15
11
|
|
|
16
12
|
export function createPermissionsCommandEntry(): ICommand {
|
|
17
13
|
return {
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
writeCommandPermissionMode,
|
|
8
8
|
} from '@robota-sdk/agent-framework';
|
|
9
9
|
|
|
10
|
-
import type { ICommandHostContext
|
|
10
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
11
|
+
import type { ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
11
12
|
|
|
12
13
|
export function executePermissionsCommand(
|
|
13
14
|
context: ICommandHostContext,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
ICommandPluginAdapter,
|
|
4
|
-
ICommandSessionRuntime,
|
|
5
|
-
} from '@robota-sdk/agent-framework';
|
|
1
|
+
import type { ICommandHostContext, ICommandSessionRuntime } from '@robota-sdk/agent-framework';
|
|
2
|
+
import type { ICommandPluginAdapter } from '@robota-sdk/agent-interface-transport';
|
|
6
3
|
import { describe, expect, it, vi } from 'vitest';
|
|
7
4
|
import { createPluginCommandModule } from '../plugin-command-module.js';
|
|
8
5
|
import { executePluginCommand, executeReloadPluginsCommand } from '../plugin-command.js';
|
|
@@ -7,12 +7,8 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { executePluginCommand, executeReloadPluginsCommand } from './plugin-command.js';
|
|
9
9
|
|
|
10
|
-
import type {
|
|
11
|
-
|
|
12
|
-
ICommandModule,
|
|
13
|
-
ICommandSource,
|
|
14
|
-
ISystemCommand,
|
|
15
|
-
} from '@robota-sdk/agent-framework';
|
|
10
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
11
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
16
12
|
|
|
17
13
|
export function createPluginCommandEntry(): ICommand {
|
|
18
14
|
return {
|
|
@@ -4,11 +4,8 @@ import {
|
|
|
4
4
|
resolvePluginCommandAdapter,
|
|
5
5
|
} from '@robota-sdk/agent-framework';
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
ICommandPluginAdapter,
|
|
10
|
-
ICommandResult,
|
|
11
|
-
} from '@robota-sdk/agent-framework';
|
|
7
|
+
import type { ICommandHostContext } from '@robota-sdk/agent-framework';
|
|
8
|
+
import type { ICommandPluginAdapter, ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
12
9
|
|
|
13
10
|
function getSubcommandParts(args: string): { subcommand: string; subArgs: string } {
|
|
14
11
|
const parts = args
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
PluginSettingsStore,
|
|
10
10
|
} from '@robota-sdk/agent-framework';
|
|
11
11
|
|
|
12
|
+
import type { IMarketplaceManifest } from '@robota-sdk/agent-framework';
|
|
12
13
|
import type {
|
|
13
14
|
ICommandAvailablePlugin,
|
|
14
15
|
ICommandInstalledPlugin,
|
|
15
16
|
ICommandMarketplaceSource,
|
|
16
17
|
ICommandPluginAdapter,
|
|
17
|
-
IMarketplaceManifest,
|
|
18
18
|
TPluginInstallScope,
|
|
19
|
-
} from '@robota-sdk/agent-
|
|
19
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
20
20
|
|
|
21
21
|
interface IPluginServices {
|
|
22
22
|
cwd: string;
|
|
@@ -7,11 +7,10 @@ import { createSetupFlow, createProviderSetupInteraction } from './provider-comm
|
|
|
7
7
|
import { formatProviderSetupChoiceLabel } from './provider-setup-flow.js';
|
|
8
8
|
|
|
9
9
|
import type {
|
|
10
|
-
ICommandInteraction,
|
|
11
|
-
ICommandResult,
|
|
12
10
|
IProviderCommandModuleOptions,
|
|
13
11
|
IProviderProfileSettings,
|
|
14
12
|
} from '@robota-sdk/agent-framework';
|
|
13
|
+
import type { ICommandInteraction, ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
15
14
|
|
|
16
15
|
export async function executeProviderCommand(
|
|
17
16
|
args: string,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { executeProviderCommand } from './provider-command-execution.js';
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
|
-
ICommand,
|
|
5
|
-
ICommandInteractionHint,
|
|
6
4
|
ICommandModule as TCommandModule,
|
|
7
|
-
ICommandSource,
|
|
8
5
|
IProviderCommandModuleOptions,
|
|
9
6
|
IProviderCommandSettingsAdapter,
|
|
10
7
|
ISystemCommand as TSystemCommand,
|
|
11
8
|
} from '@robota-sdk/agent-framework';
|
|
9
|
+
import type {
|
|
10
|
+
ICommand,
|
|
11
|
+
ICommandInteractionHint,
|
|
12
|
+
ICommandSource,
|
|
13
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
12
14
|
export type { IProviderCommandModuleOptions, IProviderCommandSettingsAdapter };
|
|
13
15
|
|
|
14
16
|
function buildProviderSubcommands(): ICommand[] {
|
|
@@ -6,11 +6,8 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { formatProviderChoiceLabel } from './provider-command-profile-operations.js';
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
ICommandResult,
|
|
12
|
-
IProviderCommandModuleOptions,
|
|
13
|
-
} from '@robota-sdk/agent-framework';
|
|
9
|
+
import type { IProviderCommandModuleOptions } from '@robota-sdk/agent-framework';
|
|
10
|
+
import type { ICommandInteraction, ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
14
11
|
|
|
15
12
|
const YES = 'yes';
|
|
16
13
|
const MAX_DUPLICATE_PROFILE_SUFFIX = 1000;
|
|
@@ -14,12 +14,11 @@ import { createProviderSetupFlow, submitProviderSetupValue } from './provider-se
|
|
|
14
14
|
|
|
15
15
|
import type { IProviderSetupFlowState } from './provider-setup-flow.js';
|
|
16
16
|
import type {
|
|
17
|
-
ICommandInteraction,
|
|
18
|
-
ICommandResult,
|
|
19
17
|
IProviderCommandModuleOptions,
|
|
20
18
|
IProviderProfileSettings,
|
|
21
19
|
IProviderSetupInput,
|
|
22
20
|
} from '@robota-sdk/agent-framework';
|
|
21
|
+
import type { ICommandInteraction, ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
23
22
|
|
|
24
23
|
export function formatProviderChoiceLabel(
|
|
25
24
|
name: string,
|
|
@@ -110,7 +109,7 @@ function getProviderProfileSetupValues(profile: IProviderProfileSettings): {
|
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
function createProviderEditInteraction(
|
|
114
113
|
flow: IProviderSetupFlowState,
|
|
115
114
|
profileName: string,
|
|
116
115
|
options: IProviderCommandModuleOptions,
|
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
} from './provider-command-profile-operations.js';
|
|
12
12
|
|
|
13
13
|
import type {
|
|
14
|
-
ICommandInteraction,
|
|
15
|
-
ICommandResult,
|
|
16
14
|
IProviderCommandModuleOptions,
|
|
17
15
|
IProviderProfileSettings,
|
|
18
16
|
} from '@robota-sdk/agent-framework';
|
|
17
|
+
import type { ICommandInteraction, ICommandResult } from '@robota-sdk/agent-interface-transport';
|
|
19
18
|
|
|
20
19
|
const ACTION_SWITCH = 'switch';
|
|
21
20
|
const ACTION_EDIT = 'edit';
|
|
@@ -10,12 +10,14 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import type { IProviderSetupFlowState } from './provider-setup-flow.js';
|
|
12
12
|
import type {
|
|
13
|
-
ICommandInteraction,
|
|
14
|
-
ICommandResult,
|
|
15
13
|
IProviderCommandModuleOptions,
|
|
16
14
|
IProviderSetupInput,
|
|
17
|
-
TCommandInteractionPrompt,
|
|
18
15
|
} from '@robota-sdk/agent-framework';
|
|
16
|
+
import type {
|
|
17
|
+
ICommandInteraction,
|
|
18
|
+
ICommandResult,
|
|
19
|
+
TCommandInteractionPrompt,
|
|
20
|
+
} from '@robota-sdk/agent-interface-transport';
|
|
19
21
|
|
|
20
22
|
const PROVIDER_RESTART_EFFECT = {
|
|
21
23
|
type: 'session-restart-requested',
|
|
@@ -59,7 +61,7 @@ export function toProviderSetupStepPrompt(
|
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
function toProviderSetupPromptDescription(
|
|
63
65
|
flow: IProviderSetupFlowState,
|
|
64
66
|
): { description: string } | Record<string, never> {
|
|
65
67
|
const description = formatProviderSetupHelpLinks(flow.setupHelpLinks);
|
|
@@ -89,7 +91,7 @@ function submitProviderSetupInteractionValue(
|
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
function completeProviderSetup(
|
|
93
95
|
input: IProviderSetupInput,
|
|
94
96
|
options: IProviderCommandModuleOptions,
|
|
95
97
|
): ICommandResult {
|
|
@@ -2,9 +2,11 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
checkSettingsDocument,
|
|
5
|
+
ProviderConfigError,
|
|
5
6
|
readMergedProviderSettings,
|
|
6
7
|
readSettings,
|
|
7
8
|
writeSettings,
|
|
9
|
+
resolveEnvDefaultProvider,
|
|
8
10
|
resolveSettingsPathForScope,
|
|
9
11
|
getProviderSettingsPaths,
|
|
10
12
|
applyProviderConfiguration,
|
|
@@ -30,6 +32,8 @@ export interface IProviderStartupContext {
|
|
|
30
32
|
export interface IEnsureProviderConfigOptions {
|
|
31
33
|
formatError: (defs: readonly IProviderDefinition[]) => string;
|
|
32
34
|
isInteractive?: () => boolean;
|
|
35
|
+
/** Environment map for env-default synthesis (test seam, default: process.env). */
|
|
36
|
+
env?: Record<string, string | undefined>;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export async function runProviderStartupSetup(
|
|
@@ -80,9 +84,17 @@ export async function ensureProviderConfig(
|
|
|
80
84
|
if (checkSettingsDocument(selectedSettings, providerDefinitions) === 'valid') {
|
|
81
85
|
return;
|
|
82
86
|
}
|
|
87
|
+
// Zero-config startup: a recognized provider env key with complete definition defaults
|
|
88
|
+
// makes setup unnecessary — resolution will synthesize an env-default config.
|
|
89
|
+
if (
|
|
90
|
+
ctx.provider === undefined &&
|
|
91
|
+
resolveEnvDefaultProvider(providerDefinitions, options.env) !== undefined
|
|
92
|
+
) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
83
95
|
const checkInteractive = options.isInteractive ?? (() => false);
|
|
84
96
|
if (!checkInteractive()) {
|
|
85
|
-
throw new
|
|
97
|
+
throw new ProviderConfigError(options.formatError(providerDefinitions));
|
|
86
98
|
}
|
|
87
99
|
await runProviderStartupSetup(
|
|
88
100
|
cwd,
|
|
@@ -95,7 +107,7 @@ export async function ensureProviderConfig(
|
|
|
95
107
|
const updatedSettings =
|
|
96
108
|
ctx.provider !== undefined ? { ...updated, currentProvider: ctx.provider } : updated;
|
|
97
109
|
if (checkSettingsDocument(updatedSettings, providerDefinitions) !== 'valid') {
|
|
98
|
-
throw new
|
|
110
|
+
throw new ProviderConfigError(options.formatError(providerDefinitions));
|
|
99
111
|
}
|
|
100
112
|
}
|
|
101
113
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { executeResetCommand } from './reset-command.js';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
ICommandModule,
|
|
6
|
-
ICommandSource,
|
|
7
|
-
ISystemCommand,
|
|
8
|
-
} from '@robota-sdk/agent-framework';
|
|
3
|
+
import type { ICommandModule, ISystemCommand } from '@robota-sdk/agent-framework';
|
|
4
|
+
import type { ICommand, ICommandSource } from '@robota-sdk/agent-interface-transport';
|
|
9
5
|
|
|
10
6
|
const RESET_COMMAND_DESCRIPTION = 'Delete settings';
|
|
11
7
|
|