@detergent-software/atk 7.13.0 → 8.0.0-dev.1
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 +7 -6
- package/build/commands/browse.js +5 -5
- package/build/commands/browse.js.map +1 -1
- package/build/commands/info.js +4 -4
- package/build/commands/info.js.map +1 -1
- package/build/commands/list.js +3 -3
- package/build/commands/list.js.map +1 -1
- package/build/commands/promote.d.ts +10 -1
- package/build/commands/promote.d.ts.map +1 -1
- package/build/commands/promote.js +30 -31
- package/build/commands/promote.js.map +1 -1
- package/build/commands/publish.js +1 -1
- package/build/commands/publish.js.map +1 -1
- package/build/commands/release-notes.js +1 -1
- package/build/commands/release-notes.js.map +1 -1
- package/build/commands/search.js +6 -6
- package/build/commands/search.js.map +1 -1
- package/build/commands/unpublish.d.ts +10 -1
- package/build/commands/unpublish.d.ts.map +1 -1
- package/build/commands/unpublish.js +30 -19
- package/build/commands/unpublish.js.map +1 -1
- package/build/components/AssetDetail.js +3 -3
- package/build/components/AssetDetail.js.map +1 -1
- package/build/components/AssetTable.d.ts +2 -2
- package/build/components/AssetTable.d.ts.map +1 -1
- package/build/components/AssetTable.js +6 -6
- package/build/components/AssetTable.js.map +1 -1
- package/build/components/BrowseExpandedBundle.d.ts +4 -4
- package/build/components/BrowseExpandedBundle.d.ts.map +1 -1
- package/build/components/BrowseExpandedBundle.js +4 -4
- package/build/components/BrowseExpandedBundle.js.map +1 -1
- package/build/components/BrowseExpandedRow.d.ts +4 -4
- package/build/components/BrowseExpandedRow.d.ts.map +1 -1
- package/build/components/BrowseExpandedRow.js +4 -4
- package/build/components/BrowseExpandedRow.js.map +1 -1
- package/build/components/BrowseList.d.ts +3 -3
- package/build/components/BrowseList.d.ts.map +1 -1
- package/build/components/BrowseList.js +8 -8
- package/build/components/BrowseList.js.map +1 -1
- package/build/components/BundleDetail.d.ts +2 -2
- package/build/components/BundleDetail.d.ts.map +1 -1
- package/build/components/BundleDetail.js +2 -2
- package/build/components/BundleDetail.js.map +1 -1
- package/build/components/ListBrowseList.d.ts +3 -3
- package/build/components/ListBrowseList.d.ts.map +1 -1
- package/build/components/ListBrowseList.js +3 -3
- package/build/components/ListBrowseList.js.map +1 -1
- package/build/components/ListExpandedRow.d.ts +4 -4
- package/build/components/ListExpandedRow.d.ts.map +1 -1
- package/build/components/ListExpandedRow.js +4 -4
- package/build/components/ListExpandedRow.js.map +1 -1
- package/build/components/RegistryChangeSummary.d.ts +21 -0
- package/build/components/RegistryChangeSummary.d.ts.map +1 -0
- package/build/components/RegistryChangeSummary.js +24 -0
- package/build/components/RegistryChangeSummary.js.map +1 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useInitState.js +6 -6
- package/build/hooks/useInitState.js.map +1 -1
- package/build/hooks/usePublishState.js +2 -2
- package/build/hooks/usePublishState.js.map +1 -1
- package/build/hooks/useRegistryChangeState.d.ts +57 -0
- package/build/hooks/useRegistryChangeState.d.ts.map +1 -0
- package/build/hooks/useRegistryChangeState.js +112 -0
- package/build/hooks/useRegistryChangeState.js.map +1 -0
- package/build/lib/api/index.d.ts +2 -2
- package/build/lib/api/index.d.ts.map +1 -1
- package/build/lib/api/index.js +1 -1
- package/build/lib/api/index.js.map +1 -1
- package/build/lib/api/sdk.gen.d.ts +21 -1
- package/build/lib/api/sdk.gen.d.ts.map +1 -1
- package/build/lib/api/sdk.gen.js +56 -0
- package/build/lib/api/sdk.gen.js.map +1 -1
- package/build/lib/api/types.gen.d.ts +387 -0
- package/build/lib/api/types.gen.d.ts.map +1 -1
- package/build/lib/api-client.d.ts +5 -0
- package/build/lib/api-client.d.ts.map +1 -1
- package/build/lib/api-client.js +32 -1
- package/build/lib/api-client.js.map +1 -1
- package/build/lib/auth.d.ts +1 -14
- package/build/lib/auth.d.ts.map +1 -1
- package/build/lib/auth.js +1 -30
- package/build/lib/auth.js.map +1 -1
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +1 -19
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/init.d.ts +10 -4
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +17 -11
- package/build/lib/init.js.map +1 -1
- package/build/lib/publisher.d.ts.map +1 -1
- package/build/lib/publisher.js +1 -7
- package/build/lib/publisher.js.map +1 -1
- package/build/lib/registry-mutate.d.ts +23 -64
- package/build/lib/registry-mutate.d.ts.map +1 -1
- package/build/lib/registry-mutate.js +50 -409
- package/build/lib/registry-mutate.js.map +1 -1
- package/build/lib/registry.d.ts.map +1 -1
- package/build/lib/registry.js +0 -23
- package/build/lib/registry.js.map +1 -1
- package/build/lib/release-notes.d.ts +18 -14
- package/build/lib/release-notes.d.ts.map +1 -1
- package/build/lib/release-notes.js +10 -42
- package/build/lib/release-notes.js.map +1 -1
- package/build/lib/schemas/config.d.ts +0 -1
- package/build/lib/schemas/config.d.ts.map +1 -1
- package/build/lib/schemas/config.js +0 -1
- package/build/lib/schemas/config.js.map +1 -1
- package/build/lib/schemas/lockfile.d.ts +0 -1
- package/build/lib/schemas/lockfile.d.ts.map +1 -1
- package/build/lib/schemas/lockfile.js +0 -1
- package/build/lib/schemas/lockfile.js.map +1 -1
- package/build/lib/web-app.d.ts +34 -0
- package/build/lib/web-app.d.ts.map +1 -0
- package/build/lib/web-app.js +39 -0
- package/build/lib/web-app.js.map +1 -0
- package/package.json +1 -1
- package/build/hooks/usePromoteState.d.ts +0 -51
- package/build/hooks/usePromoteState.d.ts.map +0 -1
- package/build/hooks/usePromoteState.js +0 -139
- package/build/hooks/usePromoteState.js.map +0 -1
- package/build/hooks/useUnpublishState.d.ts +0 -52
- package/build/hooks/useUnpublishState.d.ts.map +0 -1
- package/build/hooks/useUnpublishState.js +0 -140
- package/build/hooks/useUnpublishState.js.map +0 -1
- package/build/lib/registry-repo.d.ts +0 -34
- package/build/lib/registry-repo.d.ts.map +0 -1
- package/build/lib/registry-repo.js +0 -35
- package/build/lib/registry-repo.js.map +0 -1
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { useEffect, useReducer } from 'react';
|
|
2
|
-
import { getGitHubToken } from '../lib/auth.js';
|
|
3
|
-
import { findProjectRoot } from '../lib/paths.js';
|
|
4
|
-
import { buildPromotePlan, executePromote, mapRegistryMutateError, } from '../lib/registry-mutate.js';
|
|
5
|
-
import { fetchRegistry } from '../lib/registry.js';
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
|
-
// Reducer
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
export function createInitialState(flags) {
|
|
10
|
-
return {
|
|
11
|
-
confirmValue: '',
|
|
12
|
-
errorMessage: '',
|
|
13
|
-
flags,
|
|
14
|
-
phase: 'loading-registry',
|
|
15
|
-
plan: undefined,
|
|
16
|
-
progressMessage: '',
|
|
17
|
-
result: undefined,
|
|
18
|
-
token: undefined,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function promoteReducer(state, action) {
|
|
22
|
-
switch (action.type) {
|
|
23
|
-
case 'CANCEL':
|
|
24
|
-
if (state.phase !== 'confirming')
|
|
25
|
-
return state;
|
|
26
|
-
return { ...state, errorMessage: 'Promote cancelled.', phase: 'error' };
|
|
27
|
-
case 'CONFIRM':
|
|
28
|
-
if (state.phase !== 'confirming')
|
|
29
|
-
return state;
|
|
30
|
-
return { ...state, phase: 'executing' };
|
|
31
|
-
case 'DONE':
|
|
32
|
-
return { ...state, phase: 'done', result: action.result };
|
|
33
|
-
case 'ERROR':
|
|
34
|
-
return {
|
|
35
|
-
...state,
|
|
36
|
-
errorCommand: action.command,
|
|
37
|
-
errorHint: action.hint,
|
|
38
|
-
errorMessage: action.message,
|
|
39
|
-
phase: 'error',
|
|
40
|
-
};
|
|
41
|
-
case 'PLAN_READY': {
|
|
42
|
-
const nextPhase = state.flags.dryRun ? 'dry-run-result' : 'confirming';
|
|
43
|
-
return { ...state, phase: nextPhase, plan: action.plan, token: action.token };
|
|
44
|
-
}
|
|
45
|
-
case 'PROGRESS':
|
|
46
|
-
return { ...state, progressMessage: action.message };
|
|
47
|
-
case 'SET_CONFIRM_VALUE':
|
|
48
|
-
return { ...state, confirmValue: action.value };
|
|
49
|
-
case 'SUBMIT_CONFIRM': {
|
|
50
|
-
const trimmed = state.confirmValue.trim().toLowerCase();
|
|
51
|
-
if (trimmed === 'y' || trimmed === 'yes') {
|
|
52
|
-
return { ...state, phase: 'executing' };
|
|
53
|
-
}
|
|
54
|
-
if (trimmed === 'n' || trimmed === 'no') {
|
|
55
|
-
return { ...state, errorMessage: 'Promote cancelled.', phase: 'error' };
|
|
56
|
-
}
|
|
57
|
-
return state;
|
|
58
|
-
}
|
|
59
|
-
default:
|
|
60
|
-
return state;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
// Hook
|
|
65
|
-
// ---------------------------------------------------------------------------
|
|
66
|
-
export function usePromoteState(flags) {
|
|
67
|
-
const [state, dispatch] = useReducer(promoteReducer, undefined, () => createInitialState(flags));
|
|
68
|
-
// --- Phase: loading-registry → build plan ---
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (state.phase !== 'loading-registry')
|
|
71
|
-
return;
|
|
72
|
-
let cancelled = false;
|
|
73
|
-
const run = async () => {
|
|
74
|
-
findProjectRoot(state.flags.projectRoot);
|
|
75
|
-
const token = await getGitHubToken();
|
|
76
|
-
if (cancelled)
|
|
77
|
-
return;
|
|
78
|
-
const registry = await fetchRegistry({ force: state.flags.refresh });
|
|
79
|
-
if (cancelled)
|
|
80
|
-
return;
|
|
81
|
-
const plan = buildPromotePlan(registry, state.flags.name, state.flags.org);
|
|
82
|
-
if (cancelled)
|
|
83
|
-
return;
|
|
84
|
-
dispatch({ plan, token, type: 'PLAN_READY' });
|
|
85
|
-
};
|
|
86
|
-
run().catch((err) => {
|
|
87
|
-
if (!cancelled) {
|
|
88
|
-
dispatch({
|
|
89
|
-
command: typeof err?.command === 'string'
|
|
90
|
-
? err.command
|
|
91
|
-
: undefined,
|
|
92
|
-
hint: typeof err?.hint === 'string' ? err.hint : undefined,
|
|
93
|
-
message: mapRegistryMutateError(err),
|
|
94
|
-
type: 'ERROR',
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
return () => {
|
|
99
|
-
cancelled = true;
|
|
100
|
-
};
|
|
101
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
102
|
-
}, [state.phase]);
|
|
103
|
-
// --- Phase: executing ---
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
if (state.phase !== 'executing')
|
|
106
|
-
return;
|
|
107
|
-
if (!state.plan || !state.token)
|
|
108
|
-
return;
|
|
109
|
-
let cancelled = false;
|
|
110
|
-
const run = async () => {
|
|
111
|
-
const progress = (msg) => {
|
|
112
|
-
if (!cancelled)
|
|
113
|
-
dispatch({ message: msg, type: 'PROGRESS' });
|
|
114
|
-
};
|
|
115
|
-
const result = await executePromote(state.plan, state.token, progress);
|
|
116
|
-
if (cancelled)
|
|
117
|
-
return;
|
|
118
|
-
dispatch({ result, type: 'DONE' });
|
|
119
|
-
};
|
|
120
|
-
run().catch((err) => {
|
|
121
|
-
if (!cancelled) {
|
|
122
|
-
dispatch({
|
|
123
|
-
command: typeof err?.command === 'string'
|
|
124
|
-
? err.command
|
|
125
|
-
: undefined,
|
|
126
|
-
hint: typeof err?.hint === 'string' ? err.hint : undefined,
|
|
127
|
-
message: mapRegistryMutateError(err),
|
|
128
|
-
type: 'ERROR',
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
return () => {
|
|
133
|
-
cancelled = true;
|
|
134
|
-
};
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
-
}, [state.phase]);
|
|
137
|
-
return [state, dispatch];
|
|
138
|
-
}
|
|
139
|
-
//# sourceMappingURL=usePromoteState.js.map
|
|
@@ -1 +0,0 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oBACf,IAAI,EAAE,OAAQ,GAA0B,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;oBACxG,OAAO,EAAE,sBAAsB,CAAC,GAAG,CAAC;oBACpC,IAAI,EAAE,OAAO;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;QACF,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type RegistryMutateResult, type UnpublishPlan } from '../lib/registry-mutate.js';
|
|
2
|
-
export type UnpublishAction = {
|
|
3
|
-
command?: string;
|
|
4
|
-
hint?: string;
|
|
5
|
-
message: string;
|
|
6
|
-
type: 'ERROR';
|
|
7
|
-
} | {
|
|
8
|
-
message: string;
|
|
9
|
-
type: 'PROGRESS';
|
|
10
|
-
} | {
|
|
11
|
-
plan: UnpublishPlan;
|
|
12
|
-
token: string;
|
|
13
|
-
type: 'PLAN_READY';
|
|
14
|
-
} | {
|
|
15
|
-
result: RegistryMutateResult;
|
|
16
|
-
type: 'DONE';
|
|
17
|
-
} | {
|
|
18
|
-
type: 'CANCEL';
|
|
19
|
-
} | {
|
|
20
|
-
type: 'CONFIRM';
|
|
21
|
-
} | {
|
|
22
|
-
type: 'SET_CONFIRM_VALUE';
|
|
23
|
-
value: string;
|
|
24
|
-
} | {
|
|
25
|
-
type: 'SUBMIT_CONFIRM';
|
|
26
|
-
};
|
|
27
|
-
export interface UnpublishFlags {
|
|
28
|
-
dryRun: boolean;
|
|
29
|
-
name: string;
|
|
30
|
-
org?: string;
|
|
31
|
-
projectRoot?: string;
|
|
32
|
-
refresh?: boolean;
|
|
33
|
-
version?: string;
|
|
34
|
-
yes?: boolean;
|
|
35
|
-
}
|
|
36
|
-
export type UnpublishPhase = 'confirming' | 'done' | 'dry-run-result' | 'error' | 'executing' | 'loading-registry';
|
|
37
|
-
export interface UnpublishState {
|
|
38
|
-
confirmValue: string;
|
|
39
|
-
errorCommand?: string;
|
|
40
|
-
errorHint?: string;
|
|
41
|
-
errorMessage: string;
|
|
42
|
-
flags: UnpublishFlags;
|
|
43
|
-
phase: UnpublishPhase;
|
|
44
|
-
plan: undefined | UnpublishPlan;
|
|
45
|
-
progressMessage: string;
|
|
46
|
-
result: RegistryMutateResult | undefined;
|
|
47
|
-
token: string | undefined;
|
|
48
|
-
}
|
|
49
|
-
export declare function createInitialState(flags: UnpublishFlags): UnpublishState;
|
|
50
|
-
export declare function unpublishReducer(state: UnpublishState, action: UnpublishAction): UnpublishState;
|
|
51
|
-
export declare function useUnpublishState(flags: UnpublishFlags): readonly [UnpublishState, React.Dispatch<UnpublishAction>];
|
|
52
|
-
//# sourceMappingURL=useUnpublishState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUnpublishState.d.ts","sourceRoot":"","sources":["../../src/hooks/useUnpublishState.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAOnC,MAAM,MAAM,eAAe,GACvB;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GACnE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC1D;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,I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AE,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAkFnH"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { useEffect, useReducer } from 'react';
|
|
2
|
-
import { getGitHubToken } from '../lib/auth.js';
|
|
3
|
-
import { findProjectRoot } from '../lib/paths.js';
|
|
4
|
-
import { buildUnpublishPlan, executeUnpublish, mapRegistryMutateError, } from '../lib/registry-mutate.js';
|
|
5
|
-
import { fetchRegistry } from '../lib/registry.js';
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
|
-
// Reducer
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
export function createInitialState(flags) {
|
|
10
|
-
return {
|
|
11
|
-
confirmValue: '',
|
|
12
|
-
errorMessage: '',
|
|
13
|
-
flags,
|
|
14
|
-
phase: 'loading-registry',
|
|
15
|
-
plan: undefined,
|
|
16
|
-
progressMessage: '',
|
|
17
|
-
result: undefined,
|
|
18
|
-
token: undefined,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function unpublishReducer(state, action) {
|
|
22
|
-
switch (action.type) {
|
|
23
|
-
case 'CANCEL':
|
|
24
|
-
if (state.phase !== 'confirming')
|
|
25
|
-
return state;
|
|
26
|
-
return { ...state, errorMessage: 'Unpublish cancelled.', phase: 'error' };
|
|
27
|
-
case 'CONFIRM':
|
|
28
|
-
if (state.phase !== 'confirming')
|
|
29
|
-
return state;
|
|
30
|
-
return { ...state, phase: 'executing' };
|
|
31
|
-
case 'DONE':
|
|
32
|
-
return { ...state, phase: 'done', result: action.result };
|
|
33
|
-
case 'ERROR':
|
|
34
|
-
return {
|
|
35
|
-
...state,
|
|
36
|
-
errorCommand: action.command,
|
|
37
|
-
errorHint: action.hint,
|
|
38
|
-
errorMessage: action.message,
|
|
39
|
-
phase: 'error',
|
|
40
|
-
};
|
|
41
|
-
case 'PLAN_READY': {
|
|
42
|
-
const nextPhase = state.flags.dryRun ? 'dry-run-result' : 'confirming';
|
|
43
|
-
return { ...state, phase: nextPhase, plan: action.plan, token: action.token };
|
|
44
|
-
}
|
|
45
|
-
case 'PROGRESS':
|
|
46
|
-
return { ...state, progressMessage: action.message };
|
|
47
|
-
case 'SET_CONFIRM_VALUE':
|
|
48
|
-
return { ...state, confirmValue: action.value };
|
|
49
|
-
case 'SUBMIT_CONFIRM': {
|
|
50
|
-
const trimmed = state.confirmValue.trim().toLowerCase();
|
|
51
|
-
if (trimmed === 'y' || trimmed === 'yes') {
|
|
52
|
-
return { ...state, phase: 'executing' };
|
|
53
|
-
}
|
|
54
|
-
if (trimmed === 'n' || trimmed === 'no') {
|
|
55
|
-
return { ...state, errorMessage: 'Unpublish cancelled.', phase: 'error' };
|
|
56
|
-
}
|
|
57
|
-
return state;
|
|
58
|
-
}
|
|
59
|
-
default:
|
|
60
|
-
return state;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
// Hook
|
|
65
|
-
// ---------------------------------------------------------------------------
|
|
66
|
-
export function useUnpublishState(flags) {
|
|
67
|
-
const [state, dispatch] = useReducer(unpublishReducer, undefined, () => createInitialState(flags));
|
|
68
|
-
// --- Phase: loading-registry → build plan ---
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (state.phase !== 'loading-registry')
|
|
71
|
-
return;
|
|
72
|
-
let cancelled = false;
|
|
73
|
-
const run = async () => {
|
|
74
|
-
// Resolve project root to keep setup-gateway behavior consistent with publish.
|
|
75
|
-
findProjectRoot(state.flags.projectRoot);
|
|
76
|
-
const token = await getGitHubToken();
|
|
77
|
-
if (cancelled)
|
|
78
|
-
return;
|
|
79
|
-
const registry = await fetchRegistry({ force: state.flags.refresh });
|
|
80
|
-
if (cancelled)
|
|
81
|
-
return;
|
|
82
|
-
const plan = buildUnpublishPlan(registry, state.flags.name, state.flags.org, state.flags.version);
|
|
83
|
-
if (cancelled)
|
|
84
|
-
return;
|
|
85
|
-
dispatch({ plan, token, type: 'PLAN_READY' });
|
|
86
|
-
};
|
|
87
|
-
run().catch((err) => {
|
|
88
|
-
if (!cancelled) {
|
|
89
|
-
dispatch({
|
|
90
|
-
command: typeof err?.command === 'string'
|
|
91
|
-
? err.command
|
|
92
|
-
: undefined,
|
|
93
|
-
hint: typeof err?.hint === 'string' ? err.hint : undefined,
|
|
94
|
-
message: mapRegistryMutateError(err),
|
|
95
|
-
type: 'ERROR',
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
return () => {
|
|
100
|
-
cancelled = true;
|
|
101
|
-
};
|
|
102
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
-
}, [state.phase]);
|
|
104
|
-
// --- Phase: executing ---
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (state.phase !== 'executing')
|
|
107
|
-
return;
|
|
108
|
-
if (!state.plan || !state.token)
|
|
109
|
-
return;
|
|
110
|
-
let cancelled = false;
|
|
111
|
-
const run = async () => {
|
|
112
|
-
const progress = (msg) => {
|
|
113
|
-
if (!cancelled)
|
|
114
|
-
dispatch({ message: msg, type: 'PROGRESS' });
|
|
115
|
-
};
|
|
116
|
-
const result = await executeUnpublish(state.plan, state.token, progress);
|
|
117
|
-
if (cancelled)
|
|
118
|
-
return;
|
|
119
|
-
dispatch({ result, type: 'DONE' });
|
|
120
|
-
};
|
|
121
|
-
run().catch((err) => {
|
|
122
|
-
if (!cancelled) {
|
|
123
|
-
dispatch({
|
|
124
|
-
command: typeof err?.command === 'string'
|
|
125
|
-
? err.command
|
|
126
|
-
: undefined,
|
|
127
|
-
hint: typeof err?.hint === 'string' ? err.hint : undefined,
|
|
128
|
-
message: mapRegistryMutateError(err),
|
|
129
|
-
type: 'ERROR',
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
return () => {
|
|
134
|
-
cancelled = true;
|
|
135
|
-
};
|
|
136
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
|
-
}, [state.phase]);
|
|
138
|
-
return [state, dispatch];
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=useUnpublishState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUnpublishState.js","sourceRoot":"","sources":["../../src/hooks/useUnpublishState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GAGvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAyCnD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,KAAK;QACL,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,SAAS;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAqB,EAAE,MAAuB;IAC7E,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;gBAAE,OAAO,KAAK,CAAC;YAC/C,OAAO,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAE5E,KAAK,SAAS;YACZ,IAAI,KAAK,CAAC,KAAK,KAAK,YAAY;gBAAE,OAAO,KAAK,CAAC;YAC/C,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAE1C,KAAK,MAAM;YACT,O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AAS,EAAE,CAAC;gBACf,QAAQ,CAAC;oBACP,OAAO,EACL,OAAQ,GAA6B,EAAE,OAAO,KAAK,QAAQ;wBACzD,CAAC,CAAE,GAA2B,CAAC,OAAO;wBACtC,CAAC,CAAC,SAAS;oBACf,IAAI,EAAE,OAAQ,GAA0B,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;oBACxG,OAAO,EAAE,sBAAsB,CAAC,GAAG,CAAC;oBACpC,IAAI,EAAE,OAAO;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;QACF,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Facts about the registry GitHub repository that the CLI still needs after
|
|
3
|
-
* the data layer moved to the ATK API: its coordinates (for browsable links
|
|
4
|
-
* and the git-based `unpublish`/`promote` commands) and the directory layout
|
|
5
|
-
* of an asset version inside it.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_REGISTRY_REPO = "EmergentSoftware/agentic-toolkit-registry";
|
|
8
|
-
export declare const DEFAULT_REGISTRY_BRANCH = "main";
|
|
9
|
-
/**
|
|
10
|
-
* Build the repository-relative directory path for an asset's versioned contents
|
|
11
|
-
* (e.g. "assets/skills/@my-org/my-skill/1.0.0").
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildAssetVersionDir(asset: {
|
|
14
|
-
name: string;
|
|
15
|
-
org?: string;
|
|
16
|
-
type: string;
|
|
17
|
-
}, version: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* Build a browsable GitHub URL pointing to a bundle's README.md in the registry repo.
|
|
20
|
-
*
|
|
21
|
-
* Org bundles live under `bundles/@{org}/{name}/{version}`; global bundles under
|
|
22
|
-
* `bundles/{name}/{version}`. The stored org is bare — the `@` is display/path
|
|
23
|
-
* syntax only.
|
|
24
|
-
*/
|
|
25
|
-
export declare function buildBundleReadmeUrl(name: string, version: string, org?: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Build a browsable GitHub URL pointing to an asset's README.md in the registry repo.
|
|
28
|
-
*/
|
|
29
|
-
export declare function buildReadmeUrl(asset: {
|
|
30
|
-
name: string;
|
|
31
|
-
org?: string;
|
|
32
|
-
type: string;
|
|
33
|
-
}, version: string): string;
|
|
34
|
-
//# sourceMappingURL=registry-repo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-repo.d.ts","sourceRoot":"","sources":["../../src/lib/registry-repo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,qBAAqB,8CAA8C,CAAC;AACjF,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAIjH;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3G"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Facts about the registry GitHub repository that the CLI still needs after
|
|
3
|
-
* the data layer moved to the ATK API: its coordinates (for browsable links
|
|
4
|
-
* and the git-based `unpublish`/`promote` commands) and the directory layout
|
|
5
|
-
* of an asset version inside it.
|
|
6
|
-
*/
|
|
7
|
-
export const DEFAULT_REGISTRY_REPO = 'EmergentSoftware/agentic-toolkit-registry';
|
|
8
|
-
export const DEFAULT_REGISTRY_BRANCH = 'main';
|
|
9
|
-
/**
|
|
10
|
-
* Build the repository-relative directory path for an asset's versioned contents
|
|
11
|
-
* (e.g. "assets/skills/@my-org/my-skill/1.0.0").
|
|
12
|
-
*/
|
|
13
|
-
export function buildAssetVersionDir(asset, version) {
|
|
14
|
-
return asset.org
|
|
15
|
-
? `assets/${asset.type}s/@${asset.org}/${asset.name}/${version}`
|
|
16
|
-
: `assets/${asset.type}s/${asset.name}/${version}`;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Build a browsable GitHub URL pointing to a bundle's README.md in the registry repo.
|
|
20
|
-
*
|
|
21
|
-
* Org bundles live under `bundles/@{org}/{name}/{version}`; global bundles under
|
|
22
|
-
* `bundles/{name}/{version}`. The stored org is bare — the `@` is display/path
|
|
23
|
-
* syntax only.
|
|
24
|
-
*/
|
|
25
|
-
export function buildBundleReadmeUrl(name, version, org) {
|
|
26
|
-
const bundleDir = org ? `bundles/@${org}/${name}` : `bundles/${name}`;
|
|
27
|
-
return `https://github.com/${DEFAULT_REGISTRY_REPO}/blob/${DEFAULT_REGISTRY_BRANCH}/${bundleDir}/${version}/README.md`;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Build a browsable GitHub URL pointing to an asset's README.md in the registry repo.
|
|
31
|
-
*/
|
|
32
|
-
export function buildReadmeUrl(asset, version) {
|
|
33
|
-
return `https://github.com/${DEFAULT_REGISTRY_REPO}/blob/${DEFAULT_REGISTRY_BRANCH}/${buildAssetVersionDir(asset, version)}/README.md`;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=registry-repo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry-repo.js","sourceRoot":"","sources":["../../src/lib/registry-repo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2CAA2C,CAAC;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAmD,EAAE,OAAe;IACvG,OAAO,KAAK,CAAC,GAAG;QACd,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE;QAChE,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;AACvD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,OAAe,EAAE,GAAY;IAC9E,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC;IACtE,OAAO,sBAAsB,qBAAqB,SAAS,uBAAuB,IAAI,SAAS,IAAI,OAAO,YAAY,CAAC;AACzH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAmD,EAAE,OAAe;IACjG,OAAO,sBAAsB,qBAAqB,SAAS,uBAAuB,IAAI,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC;AACzI,CAAC"}
|