@ebay-dt/bonfire-core 0.1.0 → 0.2.0-alpha.3
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/agent.d.ts +7 -2
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +9 -2
- package/dist/agent.js.map +1 -1
- package/dist/git-management.d.ts +59 -0
- package/dist/git-management.d.ts.map +1 -0
- package/dist/git-management.js +106 -0
- package/dist/git-management.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +9 -2
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js.map +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type PrototypeRef } from "./prototype-ref.js";
|
|
2
2
|
export type Agent = "cursor" | "claude-code";
|
|
3
|
-
export type TerminalApp = "terminal" | "iterm" | "warp";
|
|
4
|
-
export type AgentCommand = "cursor" | "claude" | "osascript";
|
|
3
|
+
export type TerminalApp = "terminal" | "iterm" | "warp" | "ghostty" | "vscode";
|
|
4
|
+
export type AgentCommand = "cursor" | "claude" | "code" | "osascript";
|
|
5
|
+
export declare const TERMINAL_APPS: readonly TerminalApp[];
|
|
5
6
|
export type OpenInAgentInput = {
|
|
6
7
|
ref: PrototypeRef;
|
|
7
8
|
};
|
|
@@ -17,10 +18,14 @@ export type AgentActionError = {
|
|
|
17
18
|
agent?: Agent;
|
|
18
19
|
command?: AgentCommand;
|
|
19
20
|
terminal?: TerminalApp;
|
|
21
|
+
availableTerminals?: readonly TerminalApp[];
|
|
20
22
|
};
|
|
21
23
|
export type AgentLaunchValue = {
|
|
22
24
|
agent: Agent;
|
|
23
25
|
};
|
|
26
|
+
export type PrototypePathValue = {
|
|
27
|
+
path: string;
|
|
28
|
+
};
|
|
24
29
|
export type AgentActionResult<Value = AgentLaunchValue> = {
|
|
25
30
|
ok: true;
|
|
26
31
|
value: Value;
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC/E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAGtE,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAM/C,CAAC;AAQF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG;IACrD,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,iBAAiB,CAAC,EAAE,WAAW,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,sBAAsB,GACtB,eAAe,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,kBAAkB,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,gBAAgB,IACpD;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEtE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,MAAM,EAIvB;CACF;AAcD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,SAExC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,eAE9C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,gBAE/C;AAuBD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO;;EAOnD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,yBAcxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAgBpE","sourcesContent":["import { asRecord, deepFreeze, findUnknownKey } from \"./internal/utils.js\";\nimport {\n definePrototypeRef,\n PrototypeRefError,\n type PrototypeRef,\n} from \"./prototype-ref.js\";\n\nexport type Agent = \"cursor\" | \"claude-code\";\nexport type TerminalApp = \"terminal\" | \"iterm\" | \"warp\" | \"ghostty\" | \"vscode\";\nexport type AgentCommand = \"cursor\" | \"claude\" | \"code\" | \"osascript\";\n\nconst AGENTS: readonly Agent[] = [\"cursor\", \"claude-code\"];\nexport const TERMINAL_APPS: readonly TerminalApp[] = [\n \"terminal\",\n \"iterm\",\n \"warp\",\n \"ghostty\",\n \"vscode\",\n];\nconst AGENT_COMMANDS: readonly AgentCommand[] = [\n \"cursor\",\n \"claude\",\n \"code\",\n \"osascript\",\n];\n\nexport type OpenInAgentInput = {\n ref: PrototypeRef;\n};\n\nexport type OpenInClaudeCodeInput = OpenInAgentInput & {\n terminal?: TerminalApp;\n};\n\nexport type UserPreferences = {\n preferredTerminal?: TerminalApp;\n};\n\nexport type AgentActionErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"not-found\"\n | \"invalid-input\"\n | \"needs-terminal\"\n | \"missing-command\"\n | \"unsupported-platform\"\n | \"launch-failed\";\n\nexport type AgentActionError = {\n code: AgentActionErrorCode;\n agent?: Agent;\n command?: AgentCommand;\n terminal?: TerminalApp;\n availableTerminals?: readonly TerminalApp[];\n};\n\nexport type AgentLaunchValue = {\n agent: Agent;\n};\n\nexport type PrototypePathValue = {\n path: string;\n};\n\nexport type AgentActionResult<Value = AgentLaunchValue> =\n { ok: true; value: Value } | { ok: false; error: AgentActionError };\n\nexport class AgentInputError extends Error {\n readonly code = \"invalid-input\" as const;\n readonly path: string;\n\n constructor(path: string) {\n super(\"Invalid agent input\");\n this.name = \"AgentInputError\";\n this.path = path;\n }\n}\n\nfunction parseEnum<Value extends string>(\n value: unknown,\n values: readonly Value[],\n path: string,\n) {\n if (typeof value === \"string\" && values.includes(value as Value)) {\n return value as Value;\n }\n\n throw new AgentInputError(path);\n}\n\nexport function parseAgent(value: unknown) {\n return parseEnum(value, AGENTS, \"agent\");\n}\n\nexport function parseTerminalApp(value: unknown) {\n return parseEnum(value, TERMINAL_APPS, \"terminal\");\n}\n\nexport function parseAgentCommand(value: unknown) {\n return parseEnum(value, AGENT_COMMANDS, \"command\");\n}\n\nfunction parseInputRef(record: Record<string, unknown>) {\n if (!Object.hasOwn(record, \"ref\")) {\n throw new AgentInputError(\"ref\");\n }\n\n try {\n return definePrototypeRef(record.ref);\n } catch (error) {\n if (error instanceof PrototypeRefError) {\n throw new AgentInputError(\"ref\");\n }\n throw error;\n }\n}\n\nfunction requireInputRecord(value: unknown) {\n const record = asRecord(value);\n if (record === null) throw new AgentInputError(\"input\");\n return record;\n}\n\nexport function parseOpenInAgentInput(value: unknown) {\n const record = requireInputRecord(value);\n if (findUnknownKey(record, [\"ref\"])) {\n throw new AgentInputError(\"input\");\n }\n\n return deepFreeze({ ref: parseInputRef(record) }) satisfies OpenInAgentInput;\n}\n\nexport function parseOpenInClaudeCodeInput(value: unknown) {\n const record = requireInputRecord(value);\n if (findUnknownKey(record, [\"ref\", \"terminal\"])) {\n throw new AgentInputError(\"input\");\n }\n\n const input: OpenInClaudeCodeInput = {\n ref: parseInputRef(record),\n };\n if (record.terminal !== undefined) {\n input.terminal = parseTerminalApp(record.terminal);\n }\n\n return deepFreeze(input) satisfies OpenInClaudeCodeInput;\n}\n\n/**\n * Preference documents are intentionally forward-compatible: unknown keys are\n * ignored and an invalid terminal value means that no terminal is configured.\n */\nexport function parseUserPreferences(value: unknown): UserPreferences {\n const record = asRecord(value);\n if (record === null || !Object.hasOwn(record, \"preferredTerminal\")) {\n return Object.freeze({});\n }\n\n if (record.preferredTerminal === undefined) return Object.freeze({});\n\n try {\n return Object.freeze({\n preferredTerminal: parseTerminalApp(record.preferredTerminal),\n });\n } catch (error) {\n if (error instanceof AgentInputError) return Object.freeze({});\n throw error;\n }\n}\n"]}
|
package/dist/agent.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { asRecord, deepFreeze, findUnknownKey } from "./internal/utils.js";
|
|
2
2
|
import { definePrototypeRef, PrototypeRefError, } from "./prototype-ref.js";
|
|
3
3
|
const AGENTS = ["cursor", "claude-code"];
|
|
4
|
-
const
|
|
4
|
+
export const TERMINAL_APPS = [
|
|
5
|
+
"terminal",
|
|
6
|
+
"iterm",
|
|
7
|
+
"warp",
|
|
8
|
+
"ghostty",
|
|
9
|
+
"vscode",
|
|
10
|
+
];
|
|
5
11
|
const AGENT_COMMANDS = [
|
|
6
12
|
"cursor",
|
|
7
13
|
"claude",
|
|
14
|
+
"code",
|
|
8
15
|
"osascript",
|
|
9
16
|
];
|
|
10
17
|
export class AgentInputError extends Error {
|
|
@@ -26,7 +33,7 @@ export function parseAgent(value) {
|
|
|
26
33
|
return parseEnum(value, AGENTS, "agent");
|
|
27
34
|
}
|
|
28
35
|
export function parseTerminalApp(value) {
|
|
29
|
-
return parseEnum(value,
|
|
36
|
+
return parseEnum(value, TERMINAL_APPS, "terminal");
|
|
30
37
|
}
|
|
31
38
|
export function parseAgentCommand(value) {
|
|
32
39
|
return parseEnum(value, AGENT_COMMANDS, "command");
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAM5B,MAAM,MAAM,GAAqB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC3D,MAAM,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAM5B,MAAM,MAAM,GAAqB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,UAAU;IACV,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AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,CAAC;QACnE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAErE,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,iBAAiB,EAAE,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC;SAC9D,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,eAAe;YAAE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { asRecord, deepFreeze, findUnknownKey } from \"./internal/utils.js\";\nimport {\n definePrototypeRef,\n PrototypeRefError,\n type PrototypeRef,\n} from \"./prototype-ref.js\";\n\nexport type Agent = \"cursor\" | \"claude-code\";\nexport type TerminalApp = \"terminal\" | \"iterm\" | \"warp\" | \"ghostty\" | \"vscode\";\nexport type AgentCommand = \"cursor\" | \"claude\" | \"code\" | \"osascript\";\n\nconst AGENTS: readonly Agent[] = [\"cursor\", \"claude-code\"];\nexport const TERMINAL_APPS: readonly TerminalApp[] = [\n \"terminal\",\n \"iterm\",\n \"warp\",\n \"ghostty\",\n \"vscode\",\n];\nconst AGENT_COMMANDS: readonly AgentCommand[] = [\n \"cursor\",\n \"claude\",\n \"code\",\n \"osascript\",\n];\n\nexport type OpenInAgentInput = {\n ref: PrototypeRef;\n};\n\nexport type OpenInClaudeCodeInput = OpenInAgentInput & {\n terminal?: TerminalApp;\n};\n\nexport type UserPreferences = {\n preferredTerminal?: TerminalApp;\n};\n\nexport type AgentActionErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"not-found\"\n | \"invalid-input\"\n | \"needs-terminal\"\n | \"missing-command\"\n | \"unsupported-platform\"\n | \"launch-failed\";\n\nexport type AgentActionError = {\n code: AgentActionErrorCode;\n agent?: Agent;\n command?: AgentCommand;\n terminal?: TerminalApp;\n availableTerminals?: readonly TerminalApp[];\n};\n\nexport type AgentLaunchValue = {\n agent: Agent;\n};\n\nexport type PrototypePathValue = {\n path: string;\n};\n\nexport type AgentActionResult<Value = AgentLaunchValue> =\n { ok: true; value: Value } | { ok: false; error: AgentActionError };\n\nexport class AgentInputError extends Error {\n readonly code = \"invalid-input\" as const;\n readonly path: string;\n\n constructor(path: string) {\n super(\"Invalid agent input\");\n this.name = \"AgentInputError\";\n this.path = path;\n }\n}\n\nfunction parseEnum<Value extends string>(\n value: unknown,\n values: readonly Value[],\n path: string,\n) {\n if (typeof value === \"string\" && values.includes(value as Value)) {\n return value as Value;\n }\n\n throw new AgentInputError(path);\n}\n\nexport function parseAgent(value: unknown) {\n return parseEnum(value, AGENTS, \"agent\");\n}\n\nexport function parseTerminalApp(value: unknown) {\n return parseEnum(value, TERMINAL_APPS, \"terminal\");\n}\n\nexport function parseAgentCommand(value: unknown) {\n return parseEnum(value, AGENT_COMMANDS, \"command\");\n}\n\nfunction parseInputRef(record: Record<string, unknown>) {\n if (!Object.hasOwn(record, \"ref\")) {\n throw new AgentInputError(\"ref\");\n }\n\n try {\n return definePrototypeRef(record.ref);\n } catch (error) {\n if (error instanceof PrototypeRefError) {\n throw new AgentInputError(\"ref\");\n }\n throw error;\n }\n}\n\nfunction requireInputRecord(value: unknown) {\n const record = asRecord(value);\n if (record === null) throw new AgentInputError(\"input\");\n return record;\n}\n\nexport function parseOpenInAgentInput(value: unknown) {\n const record = requireInputRecord(value);\n if (findUnknownKey(record, [\"ref\"])) {\n throw new AgentInputError(\"input\");\n }\n\n return deepFreeze({ ref: parseInputRef(record) }) satisfies OpenInAgentInput;\n}\n\nexport function parseOpenInClaudeCodeInput(value: unknown) {\n const record = requireInputRecord(value);\n if (findUnknownKey(record, [\"ref\", \"terminal\"])) {\n throw new AgentInputError(\"input\");\n }\n\n const input: OpenInClaudeCodeInput = {\n ref: parseInputRef(record),\n };\n if (record.terminal !== undefined) {\n input.terminal = parseTerminalApp(record.terminal);\n }\n\n return deepFreeze(input) satisfies OpenInClaudeCodeInput;\n}\n\n/**\n * Preference documents are intentionally forward-compatible: unknown keys are\n * ignored and an invalid terminal value means that no terminal is configured.\n */\nexport function parseUserPreferences(value: unknown): UserPreferences {\n const record = asRecord(value);\n if (record === null || !Object.hasOwn(record, \"preferredTerminal\")) {\n return Object.freeze({});\n }\n\n if (record.preferredTerminal === undefined) return Object.freeze({});\n\n try {\n return Object.freeze({\n preferredTerminal: parseTerminalApp(record.preferredTerminal),\n });\n } catch (error) {\n if (error instanceof AgentInputError) return Object.freeze({});\n throw error;\n }\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PrototypeRef } from "./prototype-ref.js";
|
|
2
|
+
export declare const GIT_MODES: readonly ["managed", "manual"];
|
|
3
|
+
export type GitMode = (typeof GIT_MODES)[number];
|
|
4
|
+
export declare class GitModeSettingError extends Error {
|
|
5
|
+
readonly code: "invalid-input";
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
/** Parse the public managed/manual setting. Undefined preserves managed mode. */
|
|
9
|
+
export declare function parseGitModeSetting(value: unknown): GitMode;
|
|
10
|
+
export declare const REPOSITORY_READINESS_STATES: readonly ["ready", "checking", "attention", "blocked", "unavailable"];
|
|
11
|
+
export type RepositoryReadiness = (typeof REPOSITORY_READINESS_STATES)[number];
|
|
12
|
+
export declare function isRepositoryReadiness(value: unknown): value is RepositoryReadiness;
|
|
13
|
+
export declare const REPOSITORY_UPDATE_CHECK_STATES: readonly ["not-checked", "checking", "up-to-date", "updates-available", "attention", "unavailable"];
|
|
14
|
+
export type RepositoryUpdateCheckState = (typeof REPOSITORY_UPDATE_CHECK_STATES)[number];
|
|
15
|
+
export declare function isRepositoryUpdateCheckState(value: unknown): value is RepositoryUpdateCheckState;
|
|
16
|
+
export declare const REPOSITORY_ATTENTION_CODES: readonly ["dirty-worktree", "fetch-failed", "merge-conflict", "wrong-branch", "detached-head", "unresolved-operation", "missing-primary", "push-failed", "configuration-invalid", "unknown"];
|
|
17
|
+
export type RepositoryAttentionCode = (typeof REPOSITORY_ATTENTION_CODES)[number];
|
|
18
|
+
export declare const REPOSITORY_CHANGE_STATUSES: readonly ["uncommitted", "committed-unpushed", "updates-available", "unresolved", "deployment-attention"];
|
|
19
|
+
export type RepositoryChangeStatus = (typeof REPOSITORY_CHANGE_STATUSES)[number];
|
|
20
|
+
export declare const REPOSITORY_CHANGE_SCOPES: readonly ["active-prototype", "owned-prototype", "other-prototype", "out-of-scope", "unknown"];
|
|
21
|
+
export type RepositoryChangeScope = (typeof REPOSITORY_CHANGE_SCOPES)[number];
|
|
22
|
+
export type RepositoryRelativePath = string & {
|
|
23
|
+
readonly __repositoryRelativePath: unique symbol;
|
|
24
|
+
};
|
|
25
|
+
export declare class RepositoryRelativePathError extends Error {
|
|
26
|
+
readonly code: "invalid-input";
|
|
27
|
+
constructor();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Accept only normalized, repository-relative paths suitable for a client
|
|
31
|
+
* summary. Git-specific quoting, absolute paths, and parent traversal are not
|
|
32
|
+
* part of the public contract.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseRepositoryRelativePath(value: unknown): RepositoryRelativePath;
|
|
35
|
+
export type RepositoryChange = {
|
|
36
|
+
path: RepositoryRelativePath;
|
|
37
|
+
status: RepositoryChangeStatus;
|
|
38
|
+
scope: RepositoryChangeScope;
|
|
39
|
+
prototype?: PrototypeRef;
|
|
40
|
+
};
|
|
41
|
+
export type GitManagementCapabilities = {
|
|
42
|
+
mode: GitMode;
|
|
43
|
+
filesystemLifecycle: boolean;
|
|
44
|
+
gitObservation: boolean;
|
|
45
|
+
save: boolean;
|
|
46
|
+
discard: boolean;
|
|
47
|
+
getUpdates: boolean;
|
|
48
|
+
deploy: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare function getGitManagementCapabilities(mode: GitMode): GitManagementCapabilities;
|
|
51
|
+
export type RepositorySummary = {
|
|
52
|
+
mode: GitMode;
|
|
53
|
+
readiness: RepositoryReadiness;
|
|
54
|
+
updateCheck: RepositoryUpdateCheckState;
|
|
55
|
+
changes: readonly RepositoryChange[];
|
|
56
|
+
attention: readonly RepositoryAttentionCode[];
|
|
57
|
+
capabilities: GitManagementCapabilities;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=git-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-management.d.ts","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,SAAS,gCAAgD,CAAC;AACvE,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI3D;AAED,eAAO,MAAM,2BAA2B,uEAM7B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAK9B;AAED,eAAO,MAAM,8BAA8B,qGAOhC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GACpC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C;AAEF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,OAAO,GACZ,yBAAyB,CAW3B;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,mBAAmB,CAAC;IAC/B,WAAW,EAAE,0BAA0B,CAAC;IACxC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC9C,YAAY,EAAE,yBAAyB,CAAC;CACzC,CAAC","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport const GIT_MODES = Object.freeze([\"managed\", \"manual\"] as const);\nexport type GitMode = (typeof GIT_MODES)[number];\n\nexport class GitModeSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid Git management mode\");\n this.name = \"GitModeSettingError\";\n }\n}\n\n/** Parse the public managed/manual setting. Undefined preserves managed mode. */\nexport function parseGitModeSetting(value: unknown): GitMode {\n if (value === undefined || value === \"managed\") return \"managed\";\n if (value === \"manual\") return \"manual\";\n throw new GitModeSettingError();\n}\n\nexport const REPOSITORY_READINESS_STATES = Object.freeze([\n \"ready\",\n \"checking\",\n \"attention\",\n \"blocked\",\n \"unavailable\",\n] as const);\nexport type RepositoryReadiness =\n (typeof REPOSITORY_READINESS_STATES)[number];\n\nexport function isRepositoryReadiness(\n value: unknown,\n): value is RepositoryReadiness {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_READINESS_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_UPDATE_CHECK_STATES = Object.freeze([\n \"not-checked\",\n \"checking\",\n \"up-to-date\",\n \"updates-available\",\n \"attention\",\n \"unavailable\",\n] as const);\nexport type RepositoryUpdateCheckState =\n (typeof REPOSITORY_UPDATE_CHECK_STATES)[number];\n\nexport function isRepositoryUpdateCheckState(\n value: unknown,\n): value is RepositoryUpdateCheckState {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_UPDATE_CHECK_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_ATTENTION_CODES = Object.freeze([\n \"dirty-worktree\",\n \"fetch-failed\",\n \"merge-conflict\",\n \"wrong-branch\",\n \"detached-head\",\n \"unresolved-operation\",\n \"missing-primary\",\n \"push-failed\",\n \"configuration-invalid\",\n \"unknown\",\n] as const);\nexport type RepositoryAttentionCode =\n (typeof REPOSITORY_ATTENTION_CODES)[number];\n\nexport const REPOSITORY_CHANGE_STATUSES = Object.freeze([\n \"uncommitted\",\n \"committed-unpushed\",\n \"updates-available\",\n \"unresolved\",\n \"deployment-attention\",\n] as const);\nexport type RepositoryChangeStatus =\n (typeof REPOSITORY_CHANGE_STATUSES)[number];\n\nexport const REPOSITORY_CHANGE_SCOPES = Object.freeze([\n \"active-prototype\",\n \"owned-prototype\",\n \"other-prototype\",\n \"out-of-scope\",\n \"unknown\",\n] as const);\nexport type RepositoryChangeScope =\n (typeof REPOSITORY_CHANGE_SCOPES)[number];\n\nexport type RepositoryRelativePath = string & {\n readonly __repositoryRelativePath: unique symbol;\n};\n\nexport class RepositoryRelativePathError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid repository-relative path\");\n this.name = \"RepositoryRelativePathError\";\n }\n}\n\n/**\n * Accept only normalized, repository-relative paths suitable for a client\n * summary. Git-specific quoting, absolute paths, and parent traversal are not\n * part of the public contract.\n */\nexport function parseRepositoryRelativePath(\n value: unknown,\n): RepositoryRelativePath {\n if (\n typeof value !== \"string\" ||\n value.length === 0 ||\n value.length > 4096 ||\n value.includes(\"\\0\") ||\n value.includes(\"\\\\\") ||\n value.startsWith(\"/\") ||\n /^[A-Za-z]:/u.test(value)\n ) {\n throw new RepositoryRelativePathError();\n }\n\n const segments = value.split(\"/\");\n if (\n segments.some(\n (segment) => segment.length === 0 || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new RepositoryRelativePathError();\n }\n\n return value as RepositoryRelativePath;\n}\n\nexport type RepositoryChange = {\n path: RepositoryRelativePath;\n status: RepositoryChangeStatus;\n scope: RepositoryChangeScope;\n prototype?: PrototypeRef;\n};\n\nexport type GitManagementCapabilities = {\n mode: GitMode;\n filesystemLifecycle: boolean;\n gitObservation: boolean;\n save: boolean;\n discard: boolean;\n getUpdates: boolean;\n deploy: boolean;\n};\n\nexport function getGitManagementCapabilities(\n mode: GitMode,\n): GitManagementCapabilities {\n const managed = mode === \"managed\";\n return {\n mode,\n filesystemLifecycle: true,\n gitObservation: true,\n save: managed,\n discard: managed,\n getUpdates: managed,\n deploy: managed,\n };\n}\n\nexport type RepositorySummary = {\n mode: GitMode;\n readiness: RepositoryReadiness;\n updateCheck: RepositoryUpdateCheckState;\n changes: readonly RepositoryChange[];\n attention: readonly RepositoryAttentionCode[];\n capabilities: GitManagementCapabilities;\n};\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export const GIT_MODES = Object.freeze(["managed", "manual"]);
|
|
2
|
+
export class GitModeSettingError extends Error {
|
|
3
|
+
code = "invalid-input";
|
|
4
|
+
constructor() {
|
|
5
|
+
super("Invalid Git management mode");
|
|
6
|
+
this.name = "GitModeSettingError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Parse the public managed/manual setting. Undefined preserves managed mode. */
|
|
10
|
+
export function parseGitModeSetting(value) {
|
|
11
|
+
if (value === undefined || value === "managed")
|
|
12
|
+
return "managed";
|
|
13
|
+
if (value === "manual")
|
|
14
|
+
return "manual";
|
|
15
|
+
throw new GitModeSettingError();
|
|
16
|
+
}
|
|
17
|
+
export const REPOSITORY_READINESS_STATES = Object.freeze([
|
|
18
|
+
"ready",
|
|
19
|
+
"checking",
|
|
20
|
+
"attention",
|
|
21
|
+
"blocked",
|
|
22
|
+
"unavailable",
|
|
23
|
+
]);
|
|
24
|
+
export function isRepositoryReadiness(value) {
|
|
25
|
+
return (typeof value === "string" &&
|
|
26
|
+
REPOSITORY_READINESS_STATES.includes(value));
|
|
27
|
+
}
|
|
28
|
+
export const REPOSITORY_UPDATE_CHECK_STATES = Object.freeze([
|
|
29
|
+
"not-checked",
|
|
30
|
+
"checking",
|
|
31
|
+
"up-to-date",
|
|
32
|
+
"updates-available",
|
|
33
|
+
"attention",
|
|
34
|
+
"unavailable",
|
|
35
|
+
]);
|
|
36
|
+
export function isRepositoryUpdateCheckState(value) {
|
|
37
|
+
return (typeof value === "string" &&
|
|
38
|
+
REPOSITORY_UPDATE_CHECK_STATES.includes(value));
|
|
39
|
+
}
|
|
40
|
+
export const REPOSITORY_ATTENTION_CODES = Object.freeze([
|
|
41
|
+
"dirty-worktree",
|
|
42
|
+
"fetch-failed",
|
|
43
|
+
"merge-conflict",
|
|
44
|
+
"wrong-branch",
|
|
45
|
+
"detached-head",
|
|
46
|
+
"unresolved-operation",
|
|
47
|
+
"missing-primary",
|
|
48
|
+
"push-failed",
|
|
49
|
+
"configuration-invalid",
|
|
50
|
+
"unknown",
|
|
51
|
+
]);
|
|
52
|
+
export const REPOSITORY_CHANGE_STATUSES = Object.freeze([
|
|
53
|
+
"uncommitted",
|
|
54
|
+
"committed-unpushed",
|
|
55
|
+
"updates-available",
|
|
56
|
+
"unresolved",
|
|
57
|
+
"deployment-attention",
|
|
58
|
+
]);
|
|
59
|
+
export const REPOSITORY_CHANGE_SCOPES = Object.freeze([
|
|
60
|
+
"active-prototype",
|
|
61
|
+
"owned-prototype",
|
|
62
|
+
"other-prototype",
|
|
63
|
+
"out-of-scope",
|
|
64
|
+
"unknown",
|
|
65
|
+
]);
|
|
66
|
+
export class RepositoryRelativePathError extends Error {
|
|
67
|
+
code = "invalid-input";
|
|
68
|
+
constructor() {
|
|
69
|
+
super("Invalid repository-relative path");
|
|
70
|
+
this.name = "RepositoryRelativePathError";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Accept only normalized, repository-relative paths suitable for a client
|
|
75
|
+
* summary. Git-specific quoting, absolute paths, and parent traversal are not
|
|
76
|
+
* part of the public contract.
|
|
77
|
+
*/
|
|
78
|
+
export function parseRepositoryRelativePath(value) {
|
|
79
|
+
if (typeof value !== "string" ||
|
|
80
|
+
value.length === 0 ||
|
|
81
|
+
value.length > 4096 ||
|
|
82
|
+
value.includes("\0") ||
|
|
83
|
+
value.includes("\\") ||
|
|
84
|
+
value.startsWith("/") ||
|
|
85
|
+
/^[A-Za-z]:/u.test(value)) {
|
|
86
|
+
throw new RepositoryRelativePathError();
|
|
87
|
+
}
|
|
88
|
+
const segments = value.split("/");
|
|
89
|
+
if (segments.some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
90
|
+
throw new RepositoryRelativePathError();
|
|
91
|
+
}
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
export function getGitManagementCapabilities(mode) {
|
|
95
|
+
const managed = mode === "managed";
|
|
96
|
+
return {
|
|
97
|
+
mode,
|
|
98
|
+
filesystemLifecycle: true,
|
|
99
|
+
gitObservation: true,
|
|
100
|
+
save: managed,
|
|
101
|
+
discard: managed,
|
|
102
|
+
getUpdates: managed,
|
|
103
|
+
deploy: managed,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=git-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-management.js","sourceRoot":"","sources":["../src/git-management.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC,CAAC;AAGvE,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS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"manual\"] as const);\nexport type GitMode = (typeof GIT_MODES)[number];\n\nexport class GitModeSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid Git management mode\");\n this.name = \"GitModeSettingError\";\n }\n}\n\n/** Parse the public managed/manual setting. Undefined preserves managed mode. */\nexport function parseGitModeSetting(value: unknown): GitMode {\n if (value === undefined || value === \"managed\") return \"managed\";\n if (value === \"manual\") return \"manual\";\n throw new GitModeSettingError();\n}\n\nexport const REPOSITORY_READINESS_STATES = Object.freeze([\n \"ready\",\n \"checking\",\n \"attention\",\n \"blocked\",\n \"unavailable\",\n] as const);\nexport type RepositoryReadiness =\n (typeof REPOSITORY_READINESS_STATES)[number];\n\nexport function isRepositoryReadiness(\n value: unknown,\n): value is RepositoryReadiness {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_READINESS_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_UPDATE_CHECK_STATES = Object.freeze([\n \"not-checked\",\n \"checking\",\n \"up-to-date\",\n \"updates-available\",\n \"attention\",\n \"unavailable\",\n] as const);\nexport type RepositoryUpdateCheckState =\n (typeof REPOSITORY_UPDATE_CHECK_STATES)[number];\n\nexport function isRepositoryUpdateCheckState(\n value: unknown,\n): value is RepositoryUpdateCheckState {\n return (\n typeof value === \"string\" &&\n (REPOSITORY_UPDATE_CHECK_STATES as readonly string[]).includes(value)\n );\n}\n\nexport const REPOSITORY_ATTENTION_CODES = Object.freeze([\n \"dirty-worktree\",\n \"fetch-failed\",\n \"merge-conflict\",\n \"wrong-branch\",\n \"detached-head\",\n \"unresolved-operation\",\n \"missing-primary\",\n \"push-failed\",\n \"configuration-invalid\",\n \"unknown\",\n] as const);\nexport type RepositoryAttentionCode =\n (typeof REPOSITORY_ATTENTION_CODES)[number];\n\nexport const REPOSITORY_CHANGE_STATUSES = Object.freeze([\n \"uncommitted\",\n \"committed-unpushed\",\n \"updates-available\",\n \"unresolved\",\n \"deployment-attention\",\n] as const);\nexport type RepositoryChangeStatus =\n (typeof REPOSITORY_CHANGE_STATUSES)[number];\n\nexport const REPOSITORY_CHANGE_SCOPES = Object.freeze([\n \"active-prototype\",\n \"owned-prototype\",\n \"other-prototype\",\n \"out-of-scope\",\n \"unknown\",\n] as const);\nexport type RepositoryChangeScope =\n (typeof REPOSITORY_CHANGE_SCOPES)[number];\n\nexport type RepositoryRelativePath = string & {\n readonly __repositoryRelativePath: unique symbol;\n};\n\nexport class RepositoryRelativePathError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid repository-relative path\");\n this.name = \"RepositoryRelativePathError\";\n }\n}\n\n/**\n * Accept only normalized, repository-relative paths suitable for a client\n * summary. Git-specific quoting, absolute paths, and parent traversal are not\n * part of the public contract.\n */\nexport function parseRepositoryRelativePath(\n value: unknown,\n): RepositoryRelativePath {\n if (\n typeof value !== \"string\" ||\n value.length === 0 ||\n value.length > 4096 ||\n value.includes(\"\\0\") ||\n value.includes(\"\\\\\") ||\n value.startsWith(\"/\") ||\n /^[A-Za-z]:/u.test(value)\n ) {\n throw new RepositoryRelativePathError();\n }\n\n const segments = value.split(\"/\");\n if (\n segments.some(\n (segment) => segment.length === 0 || segment === \".\" || segment === \"..\",\n )\n ) {\n throw new RepositoryRelativePathError();\n }\n\n return value as RepositoryRelativePath;\n}\n\nexport type RepositoryChange = {\n path: RepositoryRelativePath;\n status: RepositoryChangeStatus;\n scope: RepositoryChangeScope;\n prototype?: PrototypeRef;\n};\n\nexport type GitManagementCapabilities = {\n mode: GitMode;\n filesystemLifecycle: boolean;\n gitObservation: boolean;\n save: boolean;\n discard: boolean;\n getUpdates: boolean;\n deploy: boolean;\n};\n\nexport function getGitManagementCapabilities(\n mode: GitMode,\n): GitManagementCapabilities {\n const managed = mode === \"managed\";\n return {\n mode,\n filesystemLifecycle: true,\n gitObservation: true,\n save: managed,\n discard: managed,\n getUpdates: managed,\n deploy: managed,\n };\n}\n\nexport type RepositorySummary = {\n mode: GitMode;\n readiness: RepositoryReadiness;\n updateCheck: RepositoryUpdateCheckState;\n changes: readonly RepositoryChange[];\n attention: readonly RepositoryAttentionCode[];\n capabilities: GitManagementCapabilities;\n};\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { defineConfig, getSessionCookieName, parseHostname, type BonfireConfig, type BonfireConfigInput, } from "./config.js";
|
|
2
2
|
export { COLOR_SCHEMES, createDefaultPrototypeTheme, parsePrototypeTheme, parsePrototypeThemeSelection, parseThemeRegistry, ThemeValidationError, type ColorScheme, type PrototypeTheme, type PrototypeThemeSelection, type ThemeDefinition, type ThemeRegistry, } from "./theme.js";
|
|
3
3
|
export { parseBonfireIdentity, BonfireIdentityError, type BonfireIdentity, } from "./identity.js";
|
|
4
|
-
export { AgentInputError, parseAgent, parseAgentCommand, parseOpenInAgentInput, parseOpenInClaudeCodeInput, parseTerminalApp, parseUserPreferences, type Agent, type AgentActionError, type AgentActionErrorCode, type AgentActionResult, type AgentCommand, type AgentLaunchValue, type OpenInAgentInput, type OpenInClaudeCodeInput, type TerminalApp, type UserPreferences, } from "./agent.js";
|
|
4
|
+
export { AgentInputError, parseAgent, parseAgentCommand, parseOpenInAgentInput, parseOpenInClaudeCodeInput, parseTerminalApp, parseUserPreferences, TERMINAL_APPS, type Agent, type AgentActionError, type AgentActionErrorCode, type AgentActionResult, type AgentCommand, type AgentLaunchValue, type OpenInAgentInput, type PrototypePathValue, type OpenInClaudeCodeInput, type TerminalApp, type UserPreferences, } from "./agent.js";
|
|
5
5
|
export type { GitHubCliLoginPageModel } from "./auth-model.js";
|
|
6
6
|
export { definePrototypeRef, getPrototypeUrl, parsePrototypePath, PrototypeRefError, slugifyPrototypeTitle, } from "./prototype-ref.js";
|
|
7
7
|
export type { PrototypeRef } from "./prototype-ref.js";
|
|
8
8
|
export { definePrototypeSummary, parsePrototypeMetadata, PrototypeMetadataError, type PrototypeMetadata, type PrototypeSummary, type PrototypeMetadataParseOptions, } from "./prototype-metadata.js";
|
|
9
9
|
export { filterPrototypes, getPrototypeAuthorOptions, sortPrototypes, type PrototypeAuthorOption, type PrototypeAuthorSelection, type PrototypeCatalogQuery, type PrototypeDashboardModel, type PrototypeSort, } from "./prototype-catalog.js";
|
|
10
|
-
export {
|
|
10
|
+
export { GIT_MODES, GitModeSettingError, REPOSITORY_ATTENTION_CODES, REPOSITORY_CHANGE_SCOPES, REPOSITORY_CHANGE_STATUSES, REPOSITORY_READINESS_STATES, REPOSITORY_UPDATE_CHECK_STATES, getGitManagementCapabilities, isRepositoryReadiness, isRepositoryUpdateCheckState, parseGitModeSetting, parseRepositoryRelativePath, RepositoryRelativePathError, type GitManagementCapabilities, type GitMode, type RepositoryAttentionCode, type RepositoryChange, type RepositoryChangeScope, type RepositoryChangeStatus, type RepositoryReadiness, type RepositoryRelativePath, type RepositorySummary, type RepositoryUpdateCheckState, } from "./git-management.js";
|
|
11
|
+
export { AutomaticBranchSwitchSettingError, DEPLOYMENT_READY_STATES, isDeploymentReadyState, isLifecycleFailure, isLifecycleSuccess, parseAutomaticBranchSwitchSetting, lifecycleFailure, lifecycleSuccess, type AutomaticBranchSwitchMode, type BranchPreparationReason, type DeploymentReadyState, type DeploymentValue, type DeploymentWarningCode, type BranchPreparationStatus, type BranchPreparationValue, type CreatePrototypeValue, type DeletePrototypeValue, type DirtyObservationStatus, type DirtyObservationValue, type DiscardPrototypeValue, type DuplicatePrototypeValue, type EditPrototypeValue, type LifecycleError, type LifecycleErrorCode, type LifecyclePrototypeValue, type ManualFilesystemMutationValue, type LifecycleRemoteStatus, type LifecycleResult, type SavePrototypeValue, } from "./lifecycle.js";
|
|
11
12
|
export { LifecycleInputError, parseCreatePrototypeInput, parseDuplicatePrototypeInput, parseEditPrototypeInput, parsePrototypeCommandInput, PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS, PROTOTYPE_TITLE_MAX_CODE_POINTS, type CreatePrototypeInput, type DuplicatePrototypeInput, type EditPrototypeInput, type PrototypeCommandInput, } from "./lifecycle-input.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,GACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,aAAa,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,kBA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sB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n TERMINAL_APPS,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type PrototypePathValue,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n GIT_MODES,\n GitModeSettingError,\n REPOSITORY_ATTENTION_CODES,\n REPOSITORY_CHANGE_SCOPES,\n REPOSITORY_CHANGE_STATUSES,\n REPOSITORY_READINESS_STATES,\n REPOSITORY_UPDATE_CHECK_STATES,\n getGitManagementCapabilities,\n isRepositoryReadiness,\n isRepositoryUpdateCheckState,\n parseGitModeSetting,\n parseRepositoryRelativePath,\n RepositoryRelativePathError,\n type GitManagementCapabilities,\n type GitMode,\n type RepositoryAttentionCode,\n type RepositoryChange,\n type RepositoryChangeScope,\n type RepositoryChangeStatus,\n type RepositoryReadiness,\n type RepositoryRelativePath,\n type RepositorySummary,\n type RepositoryUpdateCheckState,\n} from \"./git-management.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type BranchPreparationReason,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type ManualFilesystemMutationValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { defineConfig, getSessionCookieName, parseHostname, } from "./config.js";
|
|
2
2
|
export { COLOR_SCHEMES, createDefaultPrototypeTheme, parsePrototypeTheme, parsePrototypeThemeSelection, parseThemeRegistry, ThemeValidationError, } from "./theme.js";
|
|
3
3
|
export { parseBonfireIdentity, BonfireIdentityError, } from "./identity.js";
|
|
4
|
-
export { AgentInputError, parseAgent, parseAgentCommand, parseOpenInAgentInput, parseOpenInClaudeCodeInput, parseTerminalApp, parseUserPreferences, } from "./agent.js";
|
|
4
|
+
export { AgentInputError, parseAgent, parseAgentCommand, parseOpenInAgentInput, parseOpenInClaudeCodeInput, parseTerminalApp, parseUserPreferences, TERMINAL_APPS, } from "./agent.js";
|
|
5
5
|
export { definePrototypeRef, getPrototypeUrl, parsePrototypePath, PrototypeRefError, slugifyPrototypeTitle, } from "./prototype-ref.js";
|
|
6
6
|
export { definePrototypeSummary, parsePrototypeMetadata, PrototypeMetadataError, } from "./prototype-metadata.js";
|
|
7
7
|
export { filterPrototypes, getPrototypeAuthorOptions, sortPrototypes, } from "./prototype-catalog.js";
|
|
8
|
+
export { GIT_MODES, GitModeSettingError, REPOSITORY_ATTENTION_CODES, REPOSITORY_CHANGE_SCOPES, REPOSITORY_CHANGE_STATUSES, REPOSITORY_READINESS_STATES, REPOSITORY_UPDATE_CHECK_STATES, getGitManagementCapabilities, isRepositoryReadiness, isRepositoryUpdateCheckState, parseGitModeSetting, parseRepositoryRelativePath, RepositoryRelativePathError, } from "./git-management.js";
|
|
8
9
|
export { AutomaticBranchSwitchSettingError, DEPLOYMENT_READY_STATES, isDeploymentReadyState, isLifecycleFailure, isLifecycleSuccess, parseAutomaticBranchSwitchSetting, lifecycleFailure, lifecycleSuccess, } from "./lifecycle.js";
|
|
9
10
|
export { LifecycleInputError, parseCreatePrototypeInput, parseDuplicatePrototypeInput, parseEditPrototypeInput, parsePrototypeCommandInput, PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS, PROTOTYPE_TITLE_MAX_CODE_POINTS, } from "./lifecycle-input.js";
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GAMrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,GAMrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GAYd,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,GAMf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,GAW5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,gBAAgB,EAChB,gBAAgB,GAsBjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,+BAA+B,GAKhC,MAAM,sBAAsB,CAAC","sourcesContent":["export {\n defineConfig,\n getSessionCookieName,\n parseHostname,\n type BonfireConfig,\n type BonfireConfigInput,\n} from \"./config.js\";\nexport {\n COLOR_SCHEMES,\n createDefaultPrototypeTheme,\n parsePrototypeTheme,\n parsePrototypeThemeSelection,\n parseThemeRegistry,\n ThemeValidationError,\n type ColorScheme,\n type PrototypeTheme,\n type PrototypeThemeSelection,\n type ThemeDefinition,\n type ThemeRegistry,\n} from \"./theme.js\";\nexport {\n parseBonfireIdentity,\n BonfireIdentityError,\n type BonfireIdentity,\n} from \"./identity.js\";\nexport {\n AgentInputError,\n parseAgent,\n parseAgentCommand,\n parseOpenInAgentInput,\n parseOpenInClaudeCodeInput,\n parseTerminalApp,\n parseUserPreferences,\n TERMINAL_APPS,\n type Agent,\n type AgentActionError,\n type AgentActionErrorCode,\n type AgentActionResult,\n type AgentCommand,\n type AgentLaunchValue,\n type OpenInAgentInput,\n type PrototypePathValue,\n type OpenInClaudeCodeInput,\n type TerminalApp,\n type UserPreferences,\n} from \"./agent.js\";\nexport type { GitHubCliLoginPageModel } from \"./auth-model.js\";\nexport {\n definePrototypeRef,\n getPrototypeUrl,\n parsePrototypePath,\n PrototypeRefError,\n slugifyPrototypeTitle,\n} from \"./prototype-ref.js\";\nexport type { PrototypeRef } from \"./prototype-ref.js\";\nexport {\n definePrototypeSummary,\n parsePrototypeMetadata,\n PrototypeMetadataError,\n type PrototypeMetadata,\n type PrototypeSummary,\n type PrototypeMetadataParseOptions,\n} from \"./prototype-metadata.js\";\nexport {\n filterPrototypes,\n getPrototypeAuthorOptions,\n sortPrototypes,\n type PrototypeAuthorOption,\n type PrototypeAuthorSelection,\n type PrototypeCatalogQuery,\n type PrototypeDashboardModel,\n type PrototypeSort,\n} from \"./prototype-catalog.js\";\nexport {\n GIT_MODES,\n GitModeSettingError,\n REPOSITORY_ATTENTION_CODES,\n REPOSITORY_CHANGE_SCOPES,\n REPOSITORY_CHANGE_STATUSES,\n REPOSITORY_READINESS_STATES,\n REPOSITORY_UPDATE_CHECK_STATES,\n getGitManagementCapabilities,\n isRepositoryReadiness,\n isRepositoryUpdateCheckState,\n parseGitModeSetting,\n parseRepositoryRelativePath,\n RepositoryRelativePathError,\n type GitManagementCapabilities,\n type GitMode,\n type RepositoryAttentionCode,\n type RepositoryChange,\n type RepositoryChangeScope,\n type RepositoryChangeStatus,\n type RepositoryReadiness,\n type RepositoryRelativePath,\n type RepositorySummary,\n type RepositoryUpdateCheckState,\n} from \"./git-management.js\";\nexport {\n AutomaticBranchSwitchSettingError,\n DEPLOYMENT_READY_STATES,\n isDeploymentReadyState,\n isLifecycleFailure,\n isLifecycleSuccess,\n parseAutomaticBranchSwitchSetting,\n lifecycleFailure,\n lifecycleSuccess,\n type AutomaticBranchSwitchMode,\n type BranchPreparationReason,\n type DeploymentReadyState,\n type DeploymentValue,\n type DeploymentWarningCode,\n type BranchPreparationStatus,\n type BranchPreparationValue,\n type CreatePrototypeValue,\n type DeletePrototypeValue,\n type DirtyObservationStatus,\n type DirtyObservationValue,\n type DiscardPrototypeValue,\n type DuplicatePrototypeValue,\n type EditPrototypeValue,\n type LifecycleError,\n type LifecycleErrorCode,\n type LifecyclePrototypeValue,\n type ManualFilesystemMutationValue,\n type LifecycleRemoteStatus,\n type LifecycleResult,\n type SavePrototypeValue,\n} from \"./lifecycle.js\";\nexport {\n LifecycleInputError,\n parseCreatePrototypeInput,\n parseDuplicatePrototypeInput,\n parseEditPrototypeInput,\n parsePrototypeCommandInput,\n PROTOTYPE_DESCRIPTION_MAX_CODE_POINTS,\n PROTOTYPE_TITLE_MAX_CODE_POINTS,\n type CreatePrototypeInput,\n type DuplicatePrototypeInput,\n type EditPrototypeInput,\n type PrototypeCommandInput,\n} from \"./lifecycle-input.js\";\n"]}
|
package/dist/lifecycle.d.ts
CHANGED
|
@@ -20,10 +20,17 @@ export type LifecycleResult<Value> = {
|
|
|
20
20
|
ok: false;
|
|
21
21
|
error: LifecycleError;
|
|
22
22
|
};
|
|
23
|
-
export type LifecycleRemoteStatus = "pushed" | "local-only";
|
|
24
|
-
|
|
23
|
+
export type LifecycleRemoteStatus = "pushed" | "local-only" | "manual";
|
|
24
|
+
/** Explicit result marker for filesystem-only lifecycle mutations. */
|
|
25
|
+
export type ManualFilesystemMutationValue = {
|
|
26
|
+
remoteStatus: "manual";
|
|
27
|
+
};
|
|
28
|
+
export type BranchPreparationStatus = "ready" | "disabled" | "deferred" | "unsafe";
|
|
29
|
+
export type BranchPreparationReason = "dirty-worktree" | "fetch-failed" | "merge-conflict" | "detached-head" | "unresolved-operation" | "missing-primary" | "identity-divergence" | "failed-abort" | "merge-failed" | "push-failed";
|
|
25
30
|
export type BranchPreparationValue = {
|
|
26
31
|
status: BranchPreparationStatus;
|
|
32
|
+
reason?: BranchPreparationReason;
|
|
33
|
+
affectedPaths?: readonly string[];
|
|
27
34
|
};
|
|
28
35
|
export type LifecyclePrototypeValue = {
|
|
29
36
|
ref: PrototypeRef;
|
package/dist/lifecycle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,qBAAa,iCAAkC,SAAQ,KAAK;IAC1D,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,cAGC;CACF;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,GACb,yBAAyB,CAI3B;AAED,eAAO,MAAM,uBAAuB,0FAQzB,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAK/B;AAED,MAAM,MAAM,qBAAqB,GAC/B,6BAA6B,GAAG,sBAAsB,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,uBAAuB,GACvB,oBAAoB,GACpB,aAAa,GACb,oBAAoB,GACpB,wBAAwB,GACxB,SAAS,GACT,oBAAoB,CAAC;AAEzB,MAAM,MAAM,cAAc,GAAG;IAC3B,IA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AC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,IAAI,CAAC;IACf,GAAG,EAAE,YAAY,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,oBAAoB,CAAC;IACjC,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAE5E;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,GACvB,eAAe,CAAC,KAAK,CAAC,CAExB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAEtC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EACtC,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAEhD","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport type AutomaticBranchSwitchMode = \"enabled\" | \"disabled\";\n\nexport class AutomaticBranchSwitchSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid automatic branch-switch setting\");\n this.name = \"AutomaticBranchSwitchSettingError\";\n }\n}\n\nexport function parseAutomaticBranchSwitchSetting(\n value: unknown,\n): AutomaticBranchSwitchMode {\n if (value === undefined || value === \"false\") return \"enabled\";\n if (value === \"true\") return \"disabled\";\n throw new AutomaticBranchSwitchSettingError();\n}\n\nexport const DEPLOYMENT_READY_STATES = Object.freeze([\n \"BLOCKED\",\n \"BUILDING\",\n \"CANCELED\",\n \"ERROR\",\n \"INITIALIZING\",\n \"QUEUED\",\n \"READY\",\n] as const);\n\nexport type DeploymentReadyState = (typeof DEPLOYMENT_READY_STATES)[number];\n\nexport function isDeploymentReadyState(\n value: unknown,\n): value is DeploymentReadyState {\n return (\n typeof value === \"string\" &&\n (DEPLOYMENT_READY_STATES as readonly string[]).includes(value)\n );\n}\n\nexport type DeploymentWarningCode =\n \"metadata-persistence-failed\" | \"primary-merge-failed\";\n\nexport type LifecycleErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"invalid-input\"\n | \"not-found\"\n | \"already-exists\"\n | \"repository-busy\"\n | \"working-tree-conflict\"\n | \"filesystem-failure\"\n | \"git-failure\"\n | \"deployment-failure\"\n | \"deployment-unavailable\"\n | \"timeout\"\n | \"unexpected-failure\";\n\nexport type LifecycleError = {\n code: LifecycleErrorCode;\n};\n\nexport type LifecycleResult<Value> =\n { ok: true; value: Value } | { ok: false; error: LifecycleError };\n\nexport type LifecycleRemoteStatus = \"pushed\" | \"local-only\" | \"manual\";\n\n/** Explicit result marker for filesystem-only lifecycle mutations. */\nexport type ManualFilesystemMutationValue = {\n remoteStatus: \"manual\";\n};\nexport type BranchPreparationStatus =\n | \"ready\"\n | \"disabled\"\n | \"deferred\"\n | \"unsafe\";\n\nexport type BranchPreparationReason =\n | \"dirty-worktree\"\n | \"fetch-failed\"\n | \"merge-conflict\"\n | \"detached-head\"\n | \"unresolved-operation\"\n | \"missing-primary\"\n | \"identity-divergence\"\n | \"failed-abort\"\n | \"merge-failed\"\n | \"push-failed\";\n\nexport type BranchPreparationValue = {\n status: BranchPreparationStatus;\n reason?: BranchPreparationReason;\n affectedPaths?: readonly string[];\n};\n\nexport type LifecyclePrototypeValue = {\n ref: PrototypeRef;\n url: string;\n remoteStatus: LifecycleRemoteStatus;\n};\n\nexport type CreatePrototypeValue = LifecyclePrototypeValue;\nexport type DuplicatePrototypeValue = LifecyclePrototypeValue;\n\nexport type EditPrototypeValue = {\n edited: true;\n ref: PrototypeRef;\n};\n\nexport type DeletePrototypeValue = {\n deleted: true;\n ref: PrototypeRef;\n};\n\nexport type SavePrototypeValue = {\n saved: true;\n};\n\nexport type DiscardPrototypeValue = {\n discarded: true;\n};\n\nexport type DeploymentValue = {\n deployed: true;\n ref: PrototypeRef;\n previewUrl: string;\n deploymentId: string;\n readyState: DeploymentReadyState;\n warning: DeploymentWarningCode | undefined;\n};\n\nexport type DirtyObservationStatus = \"clean\" | \"dirty\";\n\nexport type DirtyObservationValue = {\n status: DirtyObservationStatus;\n /** Existing deployment preview, when one has been persisted. */\n previewUrl?: string | null;\n};\n\nexport function lifecycleSuccess<Value>(value: Value): LifecycleResult<Value> {\n return { ok: true, value };\n}\n\nexport function lifecycleFailure(\n code: LifecycleErrorCode,\n): LifecycleResult<never> {\n return { ok: false, error: { code } };\n}\n\nexport function isLifecycleSuccess<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: true; value: Value } {\n return result.ok;\n}\n\nexport function isLifecycleFailure<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: false; error: LifecycleError } {\n return !result.ok;\n}\n"]}
|
package/dist/lifecycle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,iCAAkC,SAAQ,KAAK;IACjD,IAAI,GAAG,eAAwB,CAAC;IAEzC;QACE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;IAClD,CAAC;CAC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KAAK,KAAK,QAAQ;QACxB,uBAA6C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC/D,CAAC;AACJ,CAAC;AAqGD,MAAM,UAAU,gBAAgB,CAAQ,KAAY;IAClD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAwB;IAExB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import type { PrototypeRef } from \"./prototype-ref.js\";\n\nexport type AutomaticBranchSwitchMode = \"enabled\" | \"disabled\";\n\nexport class AutomaticBranchSwitchSettingError extends Error {\n readonly code = \"invalid-input\" as const;\n\n constructor() {\n super(\"Invalid automatic branch-switch setting\");\n this.name = \"AutomaticBranchSwitchSettingError\";\n }\n}\n\nexport function parseAutomaticBranchSwitchSetting(\n value: unknown,\n): AutomaticBranchSwitchMode {\n if (value === undefined || value === \"false\") return \"enabled\";\n if (value === \"true\") return \"disabled\";\n throw new AutomaticBranchSwitchSettingError();\n}\n\nexport const DEPLOYMENT_READY_STATES = Object.freeze([\n \"BLOCKED\",\n \"BUILDING\",\n \"CANCELED\",\n \"ERROR\",\n \"INITIALIZING\",\n \"QUEUED\",\n \"READY\",\n] as const);\n\nexport type DeploymentReadyState = (typeof DEPLOYMENT_READY_STATES)[number];\n\nexport function isDeploymentReadyState(\n value: unknown,\n): value is DeploymentReadyState {\n return (\n typeof value === \"string\" &&\n (DEPLOYMENT_READY_STATES as readonly string[]).includes(value)\n );\n}\n\nexport type DeploymentWarningCode =\n \"metadata-persistence-failed\" | \"primary-merge-failed\";\n\nexport type LifecycleErrorCode =\n | \"unauthenticated\"\n | \"forbidden\"\n | \"invalid-input\"\n | \"not-found\"\n | \"already-exists\"\n | \"repository-busy\"\n | \"working-tree-conflict\"\n | \"filesystem-failure\"\n | \"git-failure\"\n | \"deployment-failure\"\n | \"deployment-unavailable\"\n | \"timeout\"\n | \"unexpected-failure\";\n\nexport type LifecycleError = {\n code: LifecycleErrorCode;\n};\n\nexport type LifecycleResult<Value> =\n { ok: true; value: Value } | { ok: false; error: LifecycleError };\n\nexport type LifecycleRemoteStatus = \"pushed\" | \"local-only\" | \"manual\";\n\n/** Explicit result marker for filesystem-only lifecycle mutations. */\nexport type ManualFilesystemMutationValue = {\n remoteStatus: \"manual\";\n};\nexport type BranchPreparationStatus =\n | \"ready\"\n | \"disabled\"\n | \"deferred\"\n | \"unsafe\";\n\nexport type BranchPreparationReason =\n | \"dirty-worktree\"\n | \"fetch-failed\"\n | \"merge-conflict\"\n | \"detached-head\"\n | \"unresolved-operation\"\n | \"missing-primary\"\n | \"identity-divergence\"\n | \"failed-abort\"\n | \"merge-failed\"\n | \"push-failed\";\n\nexport type BranchPreparationValue = {\n status: BranchPreparationStatus;\n reason?: BranchPreparationReason;\n affectedPaths?: readonly string[];\n};\n\nexport type LifecyclePrototypeValue = {\n ref: PrototypeRef;\n url: string;\n remoteStatus: LifecycleRemoteStatus;\n};\n\nexport type CreatePrototypeValue = LifecyclePrototypeValue;\nexport type DuplicatePrototypeValue = LifecyclePrototypeValue;\n\nexport type EditPrototypeValue = {\n edited: true;\n ref: PrototypeRef;\n};\n\nexport type DeletePrototypeValue = {\n deleted: true;\n ref: PrototypeRef;\n};\n\nexport type SavePrototypeValue = {\n saved: true;\n};\n\nexport type DiscardPrototypeValue = {\n discarded: true;\n};\n\nexport type DeploymentValue = {\n deployed: true;\n ref: PrototypeRef;\n previewUrl: string;\n deploymentId: string;\n readyState: DeploymentReadyState;\n warning: DeploymentWarningCode | undefined;\n};\n\nexport type DirtyObservationStatus = \"clean\" | \"dirty\";\n\nexport type DirtyObservationValue = {\n status: DirtyObservationStatus;\n /** Existing deployment preview, when one has been persisted. */\n previewUrl?: string | null;\n};\n\nexport function lifecycleSuccess<Value>(value: Value): LifecycleResult<Value> {\n return { ok: true, value };\n}\n\nexport function lifecycleFailure(\n code: LifecycleErrorCode,\n): LifecycleResult<never> {\n return { ok: false, error: { code } };\n}\n\nexport function isLifecycleSuccess<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: true; value: Value } {\n return result.ok;\n}\n\nexport function isLifecycleFailure<Value>(\n result: LifecycleResult<Value>,\n): result is { ok: false; error: LifecycleError } {\n return !result.ok;\n}\n"]}
|