@ggui-ai/cli 0.2.0-alpha.4 → 0.3.0-rc.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/README.md +38 -7
- package/dist/api-client.d.ts +42 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +30 -2
- package/dist/auth-keys.d.ts +1 -1
- package/dist/auth-keys.d.ts.map +1 -1
- package/dist/auth-keys.js +22 -7
- package/dist/auth-store.d.ts +1 -1
- package/dist/auth-store.d.ts.map +1 -1
- package/dist/cli.js +112 -30
- package/dist/config-push.d.ts +79 -0
- package/dist/config-push.d.ts.map +1 -0
- package/dist/config-push.js +301 -0
- package/dist/create-app-command.d.ts +17 -0
- package/dist/create-app-command.d.ts.map +1 -0
- package/dist/create-app-command.js +58 -0
- package/dist/deploy-command.d.ts +67 -0
- package/dist/deploy-command.d.ts.map +1 -0
- package/dist/deploy-command.js +386 -0
- package/dist/dev-command.d.ts +5 -1
- package/dist/dev-command.d.ts.map +1 -1
- package/dist/dev-command.js +31 -1
- package/dist/export-pool-command.d.ts +25 -0
- package/dist/export-pool-command.d.ts.map +1 -0
- package/dist/export-pool-command.js +116 -0
- package/dist/filesystem-seed-pool-source.d.ts +13 -0
- package/dist/filesystem-seed-pool-source.d.ts.map +1 -0
- package/dist/filesystem-seed-pool-source.js +22 -0
- package/dist/generation-probe.d.ts +53 -7
- package/dist/generation-probe.d.ts.map +1 -1
- package/dist/generation-probe.js +37 -1
- package/dist/internal/artifact-install.d.ts +4 -2
- package/dist/internal/artifact-install.d.ts.map +1 -1
- package/dist/internal/artifact-install.js +11 -10
- package/dist/internal/artifact-publish.d.ts +34 -31
- package/dist/internal/artifact-publish.d.ts.map +1 -1
- package/dist/internal/artifact-publish.js +133 -241
- package/dist/internal/artifact-search.d.ts +2 -28
- package/dist/internal/artifact-search.d.ts.map +1 -1
- package/dist/internal/artifact-search.js +5 -4
- package/dist/internal/auth-strategy.d.ts +21 -31
- package/dist/internal/auth-strategy.d.ts.map +1 -1
- package/dist/internal/auth-strategy.js +15 -23
- package/dist/internal/register-author-key.d.ts +7 -1
- package/dist/internal/register-author-key.d.ts.map +1 -1
- package/dist/internal/register-author-key.js +56 -19
- package/dist/mcp-backend.d.ts +25 -25
- package/dist/mcp-backend.d.ts.map +1 -1
- package/dist/mcp-backend.js +65 -61
- package/dist/paths.d.ts +3 -3
- package/dist/paths.js +3 -3
- package/dist/persistent-secrets.js +1 -1
- package/dist/persistent-stores.d.ts +2 -2
- package/dist/persistent-stores.d.ts.map +1 -1
- package/dist/persistent-stores.js +5 -5
- package/dist/pool-artifact.d.ts +19 -0
- package/dist/pool-artifact.d.ts.map +1 -0
- package/dist/pool-artifact.js +59 -0
- package/dist/provider-key-command.d.ts +51 -0
- package/dist/provider-key-command.d.ts.map +1 -0
- package/dist/provider-key-command.js +222 -0
- package/dist/push-command.d.ts +47 -0
- package/dist/push-command.d.ts.map +1 -0
- package/dist/push-command.js +230 -0
- package/dist/serve-command.d.ts +23 -19
- package/dist/serve-command.d.ts.map +1 -1
- package/dist/serve-command.js +13 -26
- package/dist/theme-command.js +0 -2
- package/dist/tunnel-provider.d.ts +8 -7
- package/dist/tunnel-provider.d.ts.map +1 -1
- package/package.json +25 -21
- package/dist/internal/auth-cache.d.ts +0 -40
- package/dist/internal/auth-cache.d.ts.map +0 -1
- package/dist/internal/auth-cache.js +0 -133
- package/dist/persistent-short-code-index.d.ts +0 -14
- package/dist/persistent-short-code-index.d.ts.map +0 -1
- package/dist/persistent-short-code-index.js +0 -39
- package/dist/spawn-cloudflared.d.ts +0 -61
- package/dist/spawn-cloudflared.d.ts.map +0 -1
- package/dist/spawn-cloudflared.js +0 -167
|
@@ -32,12 +32,15 @@
|
|
|
32
32
|
* inputs so tests can supply fakes without mutating `process.env` /
|
|
33
33
|
* touching the home directory.
|
|
34
34
|
*
|
|
35
|
-
* **
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* **Route precedence:** the dispatch route is chosen by
|
|
36
|
+
* {@link resolveConfiguredRoute} with precedence
|
|
37
|
+
* `GGUI_GENERATION_MODEL` env > `ggui.json#generation.model` >
|
|
38
|
+
* per-provider default. The env override is the ops escape hatch —
|
|
39
|
+
* it lets an operator point a `ggui serve` instance at a different
|
|
40
|
+
* model without editing the manifest (and lets the e2e provider
|
|
41
|
+
* matrix boot the SAME sample under different providers).
|
|
39
42
|
*/
|
|
40
|
-
import type { BlueprintProvider, GenerationDeps, HandlerContext, LlmProvider, LlmRoute,
|
|
43
|
+
import type { BlueprintProvider, GenerationDeps, HandlerContext, LlmProvider, LlmRoute, GguiSession } from '@ggui-ai/mcp-server';
|
|
41
44
|
import type { ByokKeyResolution, ByokResolver } from './byok-resolver.js';
|
|
42
45
|
/**
|
|
43
46
|
* Locked default model per provider for the OSS first-run path.
|
|
@@ -68,6 +71,49 @@ export declare const DEFAULT_ROUTE_BY_PROVIDER: Readonly<Record<Exclude<LlmProvi
|
|
|
68
71
|
* `ANTHROPIC_API_KEY` by default.
|
|
69
72
|
*/
|
|
70
73
|
export declare const PROVIDER_PROBE_ORDER: readonly Exclude<LlmProvider, 'bedrock'>[];
|
|
74
|
+
/**
|
|
75
|
+
* Env-var name for the `ggui serve` generation-model override. When
|
|
76
|
+
* set, its parsed route takes precedence over `ggui.json#generation.model`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const GENERATION_MODEL_ENV = "GGUI_GENERATION_MODEL";
|
|
79
|
+
/**
|
|
80
|
+
* Outcome of resolving the configured generation route from the env
|
|
81
|
+
* override + manifest declaration. The discriminated `kind` lets the
|
|
82
|
+
* CLI distinguish "no route configured" (fall through to the priority
|
|
83
|
+
* chain) from "an invalid override was supplied" (hard-fail with a
|
|
84
|
+
* clear operator message) without reaching for exceptions.
|
|
85
|
+
*/
|
|
86
|
+
export type ResolveConfiguredRouteResult = {
|
|
87
|
+
readonly kind: 'route';
|
|
88
|
+
readonly route: LlmRoute;
|
|
89
|
+
readonly source: 'env' | 'manifest';
|
|
90
|
+
} | {
|
|
91
|
+
readonly kind: 'none';
|
|
92
|
+
} | {
|
|
93
|
+
readonly kind: 'invalid-env';
|
|
94
|
+
readonly raw: string;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Resolve the effective `configuredRoute` for `ggui serve`, applying
|
|
98
|
+
* the precedence rule **env > manifest**:
|
|
99
|
+
*
|
|
100
|
+
* 1. `GGUI_GENERATION_MODEL` (when set + non-empty) — parsed via
|
|
101
|
+
* {@link parseAnyLlmRoute}, accepting both canonical
|
|
102
|
+
* (`openai:gpt-5.4-mini`) and LiteLLM (`gemini/gemini-3.1-flash-lite`)
|
|
103
|
+
* forms. A malformed value yields `kind: 'invalid-env'` so the
|
|
104
|
+
* caller can hard-fail rather than silently ignore the operator's
|
|
105
|
+
* intent.
|
|
106
|
+
* 2. The manifest's already-parsed `generation.model` route.
|
|
107
|
+
* 3. Neither → `kind: 'none'` (caller walks the priority chain).
|
|
108
|
+
*
|
|
109
|
+
* Bedrock routing is NOT rejected here — the CLI already gates bedrock
|
|
110
|
+
* (no OSS IAM resolver) on the resolved route, so a single check covers
|
|
111
|
+
* both the env and manifest sources.
|
|
112
|
+
*/
|
|
113
|
+
export declare function resolveConfiguredRoute(opts: {
|
|
114
|
+
readonly envModel: string | undefined;
|
|
115
|
+
readonly manifestRoute: LlmRoute | undefined;
|
|
116
|
+
}): ResolveConfiguredRouteResult;
|
|
71
117
|
export interface ProbeGenerationBindingOptions {
|
|
72
118
|
readonly resolver: ByokResolver;
|
|
73
119
|
readonly blueprints: BlueprintProvider;
|
|
@@ -98,9 +144,9 @@ export interface ProbeGenerationBindingOptions {
|
|
|
98
144
|
*/
|
|
99
145
|
readonly onNoCredentials?: (ctx: HandlerContext, story: {
|
|
100
146
|
readonly intent: string;
|
|
101
|
-
readonly
|
|
147
|
+
readonly sessionId: string;
|
|
102
148
|
readonly nowIso: string;
|
|
103
|
-
}) =>
|
|
149
|
+
}) => GguiSession | null | Promise<GguiSession | null>;
|
|
104
150
|
}
|
|
105
151
|
/**
|
|
106
152
|
* Outcome of the boot probe. Always returned (no `null` shape) —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation-probe.d.ts","sourceRoot":"","sources":["../src/generation-probe.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generation-probe.d.ts","sourceRoot":"","sources":["../src/generation-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,QAAQ,EAGR,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAC9C,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,CAMlD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,EAC1B,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GACpC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,UAAU,CAAA;CAAE,GACzF;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D;;;;;;;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AsB,sBAAsB,CAC1C,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAwF5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAWR"}
|
package/dist/generation-probe.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseAnyLlmRoute } from '@ggui-ai/protocol';
|
|
1
2
|
import { createUiGenerator } from '@ggui-ai/ui-gen';
|
|
2
3
|
/**
|
|
3
4
|
* Locked default model per provider for the OSS first-run path.
|
|
@@ -23,7 +24,7 @@ import { createUiGenerator } from '@ggui-ai/ui-gen';
|
|
|
23
24
|
export const DEFAULT_ROUTE_BY_PROVIDER = {
|
|
24
25
|
anthropic: { provider: 'anthropic', model: 'claude-haiku-4-5-20251001' },
|
|
25
26
|
openai: { provider: 'openai', model: 'gpt-5.5-2026-04-23' },
|
|
26
|
-
google: { provider: 'google', model: 'gemini-3.
|
|
27
|
+
google: { provider: 'google', model: 'gemini-3.1-flash-lite' },
|
|
27
28
|
openrouter: { provider: 'openrouter', model: 'anthropic/claude-haiku-4.5' },
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
@@ -33,6 +34,41 @@ export const DEFAULT_ROUTE_BY_PROVIDER = {
|
|
|
33
34
|
* `ANTHROPIC_API_KEY` by default.
|
|
34
35
|
*/
|
|
35
36
|
export const PROVIDER_PROBE_ORDER = ['anthropic', 'openai', 'google', 'openrouter'];
|
|
37
|
+
/**
|
|
38
|
+
* Env-var name for the `ggui serve` generation-model override. When
|
|
39
|
+
* set, its parsed route takes precedence over `ggui.json#generation.model`.
|
|
40
|
+
*/
|
|
41
|
+
export const GENERATION_MODEL_ENV = 'GGUI_GENERATION_MODEL';
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the effective `configuredRoute` for `ggui serve`, applying
|
|
44
|
+
* the precedence rule **env > manifest**:
|
|
45
|
+
*
|
|
46
|
+
* 1. `GGUI_GENERATION_MODEL` (when set + non-empty) — parsed via
|
|
47
|
+
* {@link parseAnyLlmRoute}, accepting both canonical
|
|
48
|
+
* (`openai:gpt-5.4-mini`) and LiteLLM (`gemini/gemini-3.1-flash-lite`)
|
|
49
|
+
* forms. A malformed value yields `kind: 'invalid-env'` so the
|
|
50
|
+
* caller can hard-fail rather than silently ignore the operator's
|
|
51
|
+
* intent.
|
|
52
|
+
* 2. The manifest's already-parsed `generation.model` route.
|
|
53
|
+
* 3. Neither → `kind: 'none'` (caller walks the priority chain).
|
|
54
|
+
*
|
|
55
|
+
* Bedrock routing is NOT rejected here — the CLI already gates bedrock
|
|
56
|
+
* (no OSS IAM resolver) on the resolved route, so a single check covers
|
|
57
|
+
* both the env and manifest sources.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveConfiguredRoute(opts) {
|
|
60
|
+
const trimmed = opts.envModel?.trim();
|
|
61
|
+
if (trimmed) {
|
|
62
|
+
const parsed = parseAnyLlmRoute(trimmed);
|
|
63
|
+
if (!parsed)
|
|
64
|
+
return { kind: 'invalid-env', raw: trimmed };
|
|
65
|
+
return { kind: 'route', route: parsed, source: 'env' };
|
|
66
|
+
}
|
|
67
|
+
if (opts.manifestRoute) {
|
|
68
|
+
return { kind: 'route', route: opts.manifestRoute, source: 'manifest' };
|
|
69
|
+
}
|
|
70
|
+
return { kind: 'none' };
|
|
71
|
+
}
|
|
36
72
|
/**
|
|
37
73
|
* Build a `GenerationBinding` whose `resolveLlm` does live BYOK
|
|
38
74
|
* lookup at request time (env + global → user-scope), threading
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ArtifactKind } from '@ggui-ai/registry-core';
|
|
2
|
+
/** Artifact-kind discriminator (canonical type owned by
|
|
3
|
+
* `@ggui-ai/registry-core`) — the verb the operator typed
|
|
2
4
|
* (`gadget` vs `blueprint`). Enforced against the registry-served
|
|
3
5
|
* manifest's `kind` discriminator. */
|
|
4
|
-
export type ArtifactKind
|
|
6
|
+
export type { ArtifactKind };
|
|
5
7
|
/**
|
|
6
8
|
* Resolved flags accepted by {@link runArtifactInstall}. Built by
|
|
7
9
|
* {@link parseArtifactInstallFlags} from argv or constructed directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-install.d.ts","sourceRoot":"","sources":["../../src/internal/artifact-install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"artifact-install.d.ts","sourceRoot":"","sources":["../../src/internal/artifact-install.ts"],"names":[],"mappings":"AA6EA,OAAO,EAAoB,KAAK,YAAY,EAAsB,MAAM,wBAAwB,CAAC;AAQjG;;;sCAGsC;AACtC,YAAY,EAAE,YAAY,EAAE,CAAC;AAqB7B;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAgD3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,kBAAkB,CAsGpB;AA6DD;;;;GAIG;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AAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAGT"}
|
|
@@ -71,11 +71,12 @@ import { findGguiJson, readGguiJson, writeGguiJson, } from './ggui-json.js';
|
|
|
71
71
|
* Fallback registry URL when neither `--registry`, `GGUI_REGISTRY`,
|
|
72
72
|
* nor a `ggui.json#registry` field is set.
|
|
73
73
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* Defaults to the PRODUCTION marketplace registry — an install with no
|
|
75
|
+
* explicit config must reach the real registry, not a sandbox/dev host. The
|
|
76
|
+
* `--registry` flag and the `GGUI_REGISTRY` env var always take precedence
|
|
77
|
+
* (point them at `<env>.registry.sandbox.ggui.ai` for non-prod testing).
|
|
77
78
|
*/
|
|
78
|
-
const DEFAULT_REGISTRY_URL = 'https://
|
|
79
|
+
const DEFAULT_REGISTRY_URL = 'https://registry.ggui.ai';
|
|
79
80
|
/**
|
|
80
81
|
* Build verb-specific help text. Takes the `kind` so the rendered
|
|
81
82
|
* lines say `ggui gadget install` / `ggui blueprint install` rather
|
|
@@ -762,12 +763,12 @@ export async function runArtifactInstall(flags, deps = {}) {
|
|
|
762
763
|
/* -------------------------------------------------------------------------- */
|
|
763
764
|
/**
|
|
764
765
|
* Append a {@link GadgetDescriptor} to `app.gadgets`,
|
|
765
|
-
* creating the `app` block + array if either is missing.
|
|
766
|
-
*
|
|
767
|
-
* `
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
766
|
+
* creating the `app` block + array if either is missing.
|
|
767
|
+
*
|
|
768
|
+
* `app.gadgets` carries the app's EXTENSION set only. The first-party
|
|
769
|
+
* stdlib package is unioned in as the structural floor at resolve time
|
|
770
|
+
* via `resolveAppGadgets` in `@ggui-ai/protocol` — so declaring an
|
|
771
|
+
* extension never drops stdlib hooks from the generated UI.
|
|
771
772
|
*
|
|
772
773
|
* Idempotent on `(scope, name, version)` — re-running install on the
|
|
773
774
|
* same identifier replaces the existing row rather than adding a
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CognitoIdentityProviderClient } from '@aws-sdk/client-cognito-identity-provider';
|
|
2
|
-
import { type RegistryTokenDocument } from './auth-cache.js';
|
|
3
1
|
import { type AuthFlags } from './auth-strategy.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
2
|
+
import type { ArtifactKind } from '@ggui-ai/registry-core';
|
|
3
|
+
/** Artifact-kind discriminator (canonical type owned by
|
|
4
|
+
* `@ggui-ai/registry-core`). Mirrors the manifest schema's `kind`
|
|
5
|
+
* field — passing a CLI verb's `kind` to the publish core lets it
|
|
6
|
+
* bail with a friendly redirect when the on-disk manifest doesn't
|
|
7
7
|
* match. */
|
|
8
|
-
export type ArtifactKind
|
|
8
|
+
export type { ArtifactKind };
|
|
9
9
|
/**
|
|
10
10
|
* Shape of the resolved options the publish core consumes. Built from
|
|
11
11
|
* argv by {@link parseArtifactPublishFlags} so the core function is
|
|
@@ -27,30 +27,18 @@ export interface ArtifactPublishOptions {
|
|
|
27
27
|
* Ignored for private-gadget publishes (which sign with Ed25519).
|
|
28
28
|
*/
|
|
29
29
|
readonly identityToken?: string;
|
|
30
|
-
/** Auth strategy + bearer token. `auth === undefined` →
|
|
30
|
+
/** Auth strategy + bearer token. `auth === undefined` → the stored
|
|
31
|
+
* `ggui login` session. */
|
|
31
32
|
readonly auth?: AuthFlags;
|
|
32
33
|
/** Starting directory; defaults to `process.cwd()`. */
|
|
33
34
|
readonly cwd?: string;
|
|
34
35
|
/**
|
|
35
36
|
* Test seam: inject `fetch`. Production passes `globalThis.fetch`.
|
|
36
37
|
* Typed deliberately as the `fetch` global so tests use a real
|
|
37
|
-
* `Response` object without leaking through `any`.
|
|
38
|
+
* `Response` object without leaking through `any`. Also used for the
|
|
39
|
+
* login-session refresh call (`POST /v1/auth/refresh`).
|
|
38
40
|
*/
|
|
39
41
|
readonly fetch?: typeof fetch;
|
|
40
|
-
/**
|
|
41
|
-
* Test seam: inject a hosted-auth identity-provider client. Production
|
|
42
|
-
* constructs one per call. Vendor-neutral parameter name; the AWS SDK
|
|
43
|
-
* type is reused without leaking the vendor through the parameter
|
|
44
|
-
* name — see the cloud-internal hosted-auth implementation below.
|
|
45
|
-
*/
|
|
46
|
-
readonly hostedAuthClient?: Pick<CognitoIdentityProviderClient, 'send'>;
|
|
47
|
-
/**
|
|
48
|
-
* Test seam: prompt for username + password. Production reads
|
|
49
|
-
* stdin (TTY) — tests stub the function.
|
|
50
|
-
*/
|
|
51
|
-
readonly prompt?: (label: string, opts?: {
|
|
52
|
-
hidden?: boolean;
|
|
53
|
-
}) => Promise<string>;
|
|
54
42
|
/** Test seam: write status lines. Production = process.stdout.write. */
|
|
55
43
|
readonly stdout?: (line: string) => void;
|
|
56
44
|
/** Test seam: write error lines. Production = process.stderr.write. */
|
|
@@ -181,10 +169,17 @@ export declare function resolveRegistryUrl(opts: {
|
|
|
181
169
|
readonly env: NodeJS.ProcessEnv;
|
|
182
170
|
readonly cwd: string;
|
|
183
171
|
}): RegistryResolution | RegistryUnresolved;
|
|
172
|
+
/** Which credential the publish flow is sending to the registry.
|
|
173
|
+
* Drives the 401 diagnostics — a rejected `ggui login` session points
|
|
174
|
+
* the operator at the session/bearer split; a rejected bearer token
|
|
175
|
+
* points at the registry's configured publish token. */
|
|
176
|
+
export type RegistryAuthKind = 'bearer' | 'session';
|
|
184
177
|
export interface AuthSuccess {
|
|
185
178
|
readonly ok: true;
|
|
186
|
-
|
|
187
|
-
readonly
|
|
179
|
+
/** The `ggui login` access token, sent as `Authorization: Bearer <token>`. */
|
|
180
|
+
readonly accessToken: string;
|
|
181
|
+
/** True when the stored access token had expired and was refreshed. */
|
|
182
|
+
readonly refreshed: boolean;
|
|
188
183
|
}
|
|
189
184
|
export interface AuthFailed {
|
|
190
185
|
readonly ok: false;
|
|
@@ -192,13 +187,21 @@ export interface AuthFailed {
|
|
|
192
187
|
code: 'auth_failed' | 'auth_config_missing';
|
|
193
188
|
}>;
|
|
194
189
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Resolve the `ggui login` session token for registry calls.
|
|
192
|
+
*
|
|
193
|
+
* 1. Load `~/.ggui/auth.json` (written by `ggui login`). Missing /
|
|
194
|
+
* malformed → `auth_config_missing` telling the operator to either
|
|
195
|
+
* `ggui login` or use `--auth=bearer`.
|
|
196
|
+
* 2. Fresh access token → return it as-is.
|
|
197
|
+
* 3. Expired access token + live refresh token → `POST
|
|
198
|
+
* <session.endpoint>/v1/auth/refresh`, persist the rotated session,
|
|
199
|
+
* return the new access token.
|
|
200
|
+
* 4. Expired refresh token (or refresh rejected) → `auth_failed`
|
|
201
|
+
* telling the operator to `ggui login` again.
|
|
202
|
+
*/
|
|
203
|
+
export declare function acquireLoginSessionToken(opts: {
|
|
201
204
|
readonly now: () => number;
|
|
205
|
+
readonly fetchImpl: typeof fetch;
|
|
202
206
|
}): Promise<AuthSuccess | AuthFailed>;
|
|
203
|
-
export {};
|
|
204
207
|
//# sourceMappingURL=artifact-publish.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-publish.d.ts","sourceRoot":"","sources":["../../src/internal/artifact-publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"artifact-publish.d.ts","sourceRoot":"","sources":["../../src/internal/artifact-publish.ts"],"names":[],"mappings":"AAiGA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;YAIY;AACZ,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,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