@contentful/experience-design-system-cli 2.37.1-dev-build-d5797739.0 → 2.37.1-dev-build-8b3a1c07.0
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/app.js +374 -125
- package/dist/index.js +448 -171
- package/dist/package.json +1 -1
- package/dist/src/tui/settings/agents/AgentStatusLine.d.ts +13 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +29 -0
- package/dist/src/tui/settings/agents/agent-store.d.ts +3 -0
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +13 -0
- package/dist/src/tui/settings/shared/FieldForm.d.ts +7 -1
- package/legacy/dist/src/index.js +1 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AgentName } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
|
+
import { type AgentCheck } from './agent-status.js';
|
|
4
|
+
/** The one-word state for an agent, shown on its row in the list. */
|
|
5
|
+
export declare function AgentStatusBadge({ name, checks, }: {
|
|
6
|
+
name: AgentName;
|
|
7
|
+
checks: AgentCheck[] | undefined;
|
|
8
|
+
}): React.ReactElement;
|
|
9
|
+
/** Every check that ran, one per line, and what to do next when the agent is not ready. */
|
|
10
|
+
export declare function AgentChecks({ name, checks, }: {
|
|
11
|
+
name: AgentName;
|
|
12
|
+
checks: AgentCheck[] | undefined;
|
|
13
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
type AgentCheckStep = 'path' | 'version' | 'login' | 'prompt';
|
|
3
|
+
export type AgentCheck = {
|
|
4
|
+
step: AgentCheckStep;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
/** One line for the user: the version string, the reason it failed, or what to run next. */
|
|
7
|
+
detail: string;
|
|
8
|
+
};
|
|
9
|
+
/** The one-word state shown on an agent's row. `unknown` means it runs but its login cannot be checked. */
|
|
10
|
+
export type AgentStatus = 'checking' | 'ready' | 'not-found' | 'not-logged-in' | 'unknown';
|
|
11
|
+
/**
|
|
12
|
+
* The binary the import will actually run for this agent: the saved path if there is one, otherwise the built-in
|
|
13
|
+
* command name. Shown in the form so the user sees what is used when the field is empty.
|
|
14
|
+
*/
|
|
15
|
+
export declare function effectiveBinary(name: AgentName, savedBinary: string): string;
|
|
16
|
+
/** The model the agent runs with when none is saved ("haiku", "gpt-mini", or the agent's own pick), for the model row. */
|
|
17
|
+
export declare function defaultModelLabel(name: AgentName): string;
|
|
18
|
+
/**
|
|
19
|
+
* Steps 1 to 3 against `binary`. Never throws and never spends tokens, so it is safe to run for every row on open.
|
|
20
|
+
* Checks the path the user typed, not what is saved, so the form can test a value before it is written.
|
|
21
|
+
*/
|
|
22
|
+
export declare function inspectAgent(name: AgentName, binary: string): Promise<AgentCheck[]>;
|
|
23
|
+
/** Steps 1 to 4. The prompt step is the only way to verify login and model name for agents other than claude. */
|
|
24
|
+
export declare function testAgent(name: AgentName, binary: string, model: string): Promise<AgentCheck[]>;
|
|
25
|
+
/** Collapses a list of checks into the status shown on the row. */
|
|
26
|
+
export declare function statusFromChecks(name: AgentName, checks: readonly AgentCheck[]): AgentStatus;
|
|
27
|
+
/** What to tell a user whose agent is not ready: the install command, or the login command. Empty when nothing is needed. */
|
|
28
|
+
export declare function nextStepHint(name: AgentName, status: AgentStatus): string;
|
|
29
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
2
|
export type AgentSettings = {
|
|
3
|
+
/** Passed as --model. Empty: the agent's built-in default (see defaultModelLabel). */
|
|
3
4
|
model: string;
|
|
5
|
+
/** Path to the agent's command. Empty: the command name is looked up on the PATH. */
|
|
6
|
+
binary: string;
|
|
4
7
|
};
|
|
5
8
|
export type AgentConfig = {
|
|
6
9
|
/** The agent the CLI uses when `--agent` is not given. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentConfig } from './agent-store.js';
|
|
2
|
+
/**
|
|
3
|
+
* The pipeline picks an agent's binary from `EDS_AGENT_BINARY_<AGENT>` and nowhere else. This copies each saved
|
|
4
|
+
* `agents.<name>.binary` into that variable, so the saved path reaches every place that spawns an agent (the import,
|
|
5
|
+
* the generation package and the legacy commands) without touching their call sites.
|
|
6
|
+
*
|
|
7
|
+
* Called once at startup, and again after Settings saves a binary so a change applies without a restart.
|
|
8
|
+
*
|
|
9
|
+
* Settings wins over a variable already in the shell, so a forgotten `EDS_AGENT_BINARY_CLAUDE` cannot silently override
|
|
10
|
+
* what the user sees on screen. An agent with no saved path leaves the shell's variable alone, and clearing a path
|
|
11
|
+
* puts the shell's value back.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyBinaryOverrides(config: AgentConfig): void;
|
|
@@ -26,10 +26,16 @@ interface FieldFormProps<K extends string> {
|
|
|
26
26
|
busy?: boolean;
|
|
27
27
|
/** Shown above the controls, for a screen's own explanation. */
|
|
28
28
|
footer?: React.ReactNode;
|
|
29
|
+
/** Extra single-key actions. They only fire when no field is open, so typing a "t" into a path is just a "t". */
|
|
30
|
+
actions?: readonly {
|
|
31
|
+
key: string;
|
|
32
|
+
label: string;
|
|
33
|
+
run: () => void;
|
|
34
|
+
}[];
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* The edit-in-place form the Configuration pages share. Fields are read-only until Enter opens one; Enter again closes it.
|
|
32
38
|
* While one is open, keys type into it (so a "q" in a path is just a "q"), and Esc closes it and restores the old value.
|
|
33
39
|
*/
|
|
34
|
-
export declare function FieldForm<K extends string>({ title, subtitle, fields, values, onChange, onSave, onQuit, notice, busy, footer, }: FieldFormProps<K>): React.ReactElement;
|
|
40
|
+
export declare function FieldForm<K extends string>({ title, subtitle, fields, values, onChange, onSave, onQuit, notice, busy, footer, actions, }: FieldFormProps<K>): React.ReactElement;
|
|
35
41
|
export {};
|
package/legacy/dist/src/index.js
CHANGED
|
@@ -19579,6 +19579,7 @@ var init_src5 = __esm({
|
|
|
19579
19579
|
init_agents();
|
|
19580
19580
|
init_agent_name();
|
|
19581
19581
|
init_models();
|
|
19582
|
+
init_binaries();
|
|
19582
19583
|
init_is_agent_name();
|
|
19583
19584
|
init_agent_supports_bedrock();
|
|
19584
19585
|
init_check_agent_auth2();
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-8b3a1c07.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-
|
|
49
|
-
"@contentful/experience-design-system-
|
|
48
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-8b3a1c07.0",
|
|
49
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-8b3a1c07.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|