agents-inc 0.167.0 → 0.170.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/CHANGELOG.md +31 -0
- package/README.md +18 -15
- package/dist/{chunk-ZR4YPKXQ.js → chunk-3G7X2WKI.js} +4 -4
- package/dist/{chunk-JOEA52NR.js → chunk-44TE3RKH.js} +46 -2
- package/dist/chunk-44TE3RKH.js.map +1 -0
- package/dist/{chunk-V5WXIM2F.js → chunk-52HDHJ7I.js} +11 -19
- package/dist/chunk-52HDHJ7I.js.map +1 -0
- package/dist/{chunk-V3I7VQ7N.js → chunk-6HNXYYVF.js} +39 -22
- package/dist/chunk-6HNXYYVF.js.map +1 -0
- package/dist/{chunk-MAWNVT2C.js → chunk-6ZRH5RHC.js} +10 -11
- package/dist/chunk-6ZRH5RHC.js.map +1 -0
- package/dist/{chunk-G6UREQ4V.js → chunk-7RDMTR64.js} +14 -34
- package/dist/chunk-7RDMTR64.js.map +1 -0
- package/dist/{chunk-GE3WKJ6Q.js → chunk-BMRUNMPV.js} +4 -4
- package/dist/{chunk-VAPTVR3J.js → chunk-CLPUWOSA.js} +4 -4
- package/dist/{chunk-VAPTVR3J.js.map → chunk-CLPUWOSA.js.map} +1 -1
- package/dist/{chunk-HWEKHVLE.js → chunk-F2BHT5C4.js} +9 -7
- package/dist/chunk-F2BHT5C4.js.map +1 -0
- package/dist/{chunk-ZXKBERQU.js → chunk-F5EBEATU.js} +2 -2
- package/dist/{chunk-PMJWD27C.js → chunk-HED2DAXZ.js} +3 -3
- package/dist/{chunk-SAYZWCH6.js → chunk-KOLDW6SF.js} +3 -3
- package/dist/{chunk-SAYZWCH6.js.map → chunk-KOLDW6SF.js.map} +1 -1
- package/dist/{chunk-A4KDXNOT.js → chunk-MQ6CGZNJ.js} +171 -522
- package/dist/chunk-MQ6CGZNJ.js.map +1 -0
- package/dist/{chunk-G4JK7WVO.js → chunk-NCWDK6L7.js} +115 -196
- package/dist/chunk-NCWDK6L7.js.map +1 -0
- package/dist/{chunk-VRXX4D6K.js → chunk-NEZ4OAOL.js} +1 -1
- package/dist/chunk-NEZ4OAOL.js.map +1 -0
- package/dist/chunk-NIHUOWE4.js +106 -0
- package/dist/chunk-NIHUOWE4.js.map +1 -0
- package/dist/{chunk-OI2H6M5I.js → chunk-NQW25DCF.js} +2 -2
- package/dist/chunk-NQW25DCF.js.map +1 -0
- package/dist/{chunk-25MPBIK3.js → chunk-OYJQUA3D.js} +3 -3
- package/dist/{chunk-25MPBIK3.js.map → chunk-OYJQUA3D.js.map} +1 -1
- package/dist/{chunk-ENGYJCTF.js → chunk-PJWGTNOX.js} +220 -254
- package/dist/chunk-PJWGTNOX.js.map +1 -0
- package/dist/{chunk-NBXXFIIW.js → chunk-RIPSGNLU.js} +3 -3
- package/dist/chunk-RIPSGNLU.js.map +1 -0
- package/dist/{chunk-Y47EV74W.js → chunk-SZYQISA2.js} +10 -13
- package/dist/chunk-SZYQISA2.js.map +1 -0
- package/dist/{chunk-TODCQFRB.js → chunk-USVBYQSQ.js} +2 -2
- package/dist/{chunk-Y3VIRVVE.js → chunk-V3KTSP3Q.js} +50 -42
- package/dist/chunk-V3KTSP3Q.js.map +1 -0
- package/dist/{chunk-PXWG7KFO.js → chunk-WTWMGH2C.js} +2 -2
- package/dist/commands/build/marketplace.js +23 -22
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +8 -9
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +19 -20
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +17 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +138 -488
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +21 -33
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -45
- package/dist/commands/list.js +19 -17
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +11 -11
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +12 -13
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +11 -12
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +18 -20
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +8 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/scroll-affordance.js +9 -0
- package/dist/components/common/select-list.js +2 -3
- package/dist/components/common/skill-agent-summary.js +11 -0
- package/dist/components/common/spinner.js +1 -1
- package/dist/{chunk-2VUYFTUB.js → components/common/summary-panel.js} +57 -31
- package/dist/components/common/summary-panel.js.map +1 -0
- package/dist/config-exports.js +1 -1
- package/dist/hooks/init.js +18 -46
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-YMDWBFDP.js +14 -0
- package/dist/recompile-project-agents-SZ76WNTW.js +18 -0
- package/dist/{source-loader-7KZ3MD5O.js → source-loader-C5SQXZXI.js} +5 -5
- package/dist/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/package.json +6 -4
- package/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/src/schemas/project-config.schema.json +1 -1
- package/assets/demo.tape +0 -266
- package/dist/chunk-2VUYFTUB.js.map +0 -1
- package/dist/chunk-4NDBUJHK.js +0 -237
- package/dist/chunk-4NDBUJHK.js.map +0 -1
- package/dist/chunk-6L75SQZU.js +0 -168
- package/dist/chunk-6L75SQZU.js.map +0 -1
- package/dist/chunk-6LF4CQBY.js +0 -51
- package/dist/chunk-6LF4CQBY.js.map +0 -1
- package/dist/chunk-7JNJ52CD.js +0 -1179
- package/dist/chunk-7JNJ52CD.js.map +0 -1
- package/dist/chunk-A4KDXNOT.js.map +0 -1
- package/dist/chunk-DAIEQJIF.js +0 -48
- package/dist/chunk-DAIEQJIF.js.map +0 -1
- package/dist/chunk-ENGYJCTF.js.map +0 -1
- package/dist/chunk-G4JK7WVO.js.map +0 -1
- package/dist/chunk-G6UREQ4V.js.map +0 -1
- package/dist/chunk-HHIYT3PI.js +0 -53
- package/dist/chunk-HHIYT3PI.js.map +0 -1
- package/dist/chunk-HWEKHVLE.js.map +0 -1
- package/dist/chunk-JOEA52NR.js.map +0 -1
- package/dist/chunk-JQRJQ4SS.js +0 -118
- package/dist/chunk-JQRJQ4SS.js.map +0 -1
- package/dist/chunk-LFWLEDUG.js +0 -59
- package/dist/chunk-LFWLEDUG.js.map +0 -1
- package/dist/chunk-MAWNVT2C.js.map +0 -1
- package/dist/chunk-MPTNC32T.js +0 -92
- package/dist/chunk-MPTNC32T.js.map +0 -1
- package/dist/chunk-NBXXFIIW.js.map +0 -1
- package/dist/chunk-OI2H6M5I.js.map +0 -1
- package/dist/chunk-PNB3524H.js +0 -197
- package/dist/chunk-PNB3524H.js.map +0 -1
- package/dist/chunk-QHDPLLK6.js +0 -35
- package/dist/chunk-QHDPLLK6.js.map +0 -1
- package/dist/chunk-RAHSOJQ2.js +0 -25
- package/dist/chunk-RAHSOJQ2.js.map +0 -1
- package/dist/chunk-RZDXDMT6.js +0 -23
- package/dist/chunk-RZDXDMT6.js.map +0 -1
- package/dist/chunk-SCOQ34YM.js +0 -17
- package/dist/chunk-SCOQ34YM.js.map +0 -1
- package/dist/chunk-SXVHSOTH.js +0 -268
- package/dist/chunk-SXVHSOTH.js.map +0 -1
- package/dist/chunk-T6UWJAB3.js +0 -28
- package/dist/chunk-T6UWJAB3.js.map +0 -1
- package/dist/chunk-TSIU7DME.js +0 -43
- package/dist/chunk-TSIU7DME.js.map +0 -1
- package/dist/chunk-TTY6DPJN.js +0 -27
- package/dist/chunk-TTY6DPJN.js.map +0 -1
- package/dist/chunk-TZ2YJJKK.js +0 -292
- package/dist/chunk-TZ2YJJKK.js.map +0 -1
- package/dist/chunk-V3I7VQ7N.js.map +0 -1
- package/dist/chunk-V5WXIM2F.js.map +0 -1
- package/dist/chunk-VRXX4D6K.js.map +0 -1
- package/dist/chunk-WTJ3AY33.js +0 -31
- package/dist/chunk-WTJ3AY33.js.map +0 -1
- package/dist/chunk-WVUDLKIO.js +0 -121
- package/dist/chunk-WVUDLKIO.js.map +0 -1
- package/dist/chunk-WWIFNPJG.js +0 -317
- package/dist/chunk-WWIFNPJG.js.map +0 -1
- package/dist/chunk-XQHZPINL.js +0 -89
- package/dist/chunk-XQHZPINL.js.map +0 -1
- package/dist/chunk-XZEVWPX6.js +0 -230
- package/dist/chunk-XZEVWPX6.js.map +0 -1
- package/dist/chunk-Y3VIRVVE.js.map +0 -1
- package/dist/chunk-Y47EV74W.js.map +0 -1
- package/dist/components/wizard/category-grid.js +0 -13
- package/dist/components/wizard/checkbox-grid.js +0 -12
- package/dist/components/wizard/domain-selection.js +0 -18
- package/dist/components/wizard/run-wizard-session.js +0 -40
- package/dist/components/wizard/run-wizard-session.js.map +0 -1
- package/dist/components/wizard/scroll-affordance.js +0 -9
- package/dist/components/wizard/skill-agent-summary.js +0 -13
- package/dist/components/wizard/source-grid.js +0 -16
- package/dist/components/wizard/source-grid.js.map +0 -1
- package/dist/components/wizard/stack-selection.js +0 -17
- package/dist/components/wizard/stack-selection.js.map +0 -1
- package/dist/components/wizard/step-agents.js +0 -18
- package/dist/components/wizard/step-agents.js.map +0 -1
- package/dist/components/wizard/step-build.js +0 -18
- package/dist/components/wizard/step-build.js.map +0 -1
- package/dist/components/wizard/step-confirm.js +0 -18
- package/dist/components/wizard/step-confirm.js.map +0 -1
- package/dist/components/wizard/step-sources.js +0 -19
- package/dist/components/wizard/step-sources.js.map +0 -1
- package/dist/components/wizard/step-stack.js +0 -18
- package/dist/components/wizard/step-stack.js.map +0 -1
- package/dist/components/wizard/summary-panel.js +0 -17
- package/dist/components/wizard/summary-panel.js.map +0 -1
- package/dist/components/wizard/toast.js +0 -9
- package/dist/components/wizard/toast.js.map +0 -1
- package/dist/components/wizard/wizard-layout.js +0 -22
- package/dist/components/wizard/wizard-layout.js.map +0 -1
- package/dist/components/wizard/wizard-tabs.js +0 -11
- package/dist/components/wizard/wizard-tabs.js.map +0 -1
- package/dist/components/wizard/wizard.js +0 -39
- package/dist/components/wizard/wizard.js.map +0 -1
- package/dist/load-agent-defs-3C27ENC7.js +0 -14
- package/dist/load-agent-defs-3C27ENC7.js.map +0 -1
- package/dist/recompile-project-agents-DGNBCU3N.js +0 -18
- package/dist/recompile-project-agents-DGNBCU3N.js.map +0 -1
- package/dist/source-loader-7KZ3MD5O.js.map +0 -1
- package/dist/stores/wizard-store.js +0 -24
- package/dist/stores/wizard-store.js.map +0 -1
- /package/assets/{demo.gif → legacy-wizard.gif} +0 -0
- /package/dist/{chunk-ZR4YPKXQ.js.map → chunk-3G7X2WKI.js.map} +0 -0
- /package/dist/{chunk-GE3WKJ6Q.js.map → chunk-BMRUNMPV.js.map} +0 -0
- /package/dist/{chunk-ZXKBERQU.js.map → chunk-F5EBEATU.js.map} +0 -0
- /package/dist/{chunk-PMJWD27C.js.map → chunk-HED2DAXZ.js.map} +0 -0
- /package/dist/{chunk-TODCQFRB.js.map → chunk-USVBYQSQ.js.map} +0 -0
- /package/dist/{chunk-PXWG7KFO.js.map → chunk-WTWMGH2C.js.map} +0 -0
- /package/dist/components/{wizard → common}/scroll-affordance.js.map +0 -0
- /package/dist/components/{wizard → common}/skill-agent-summary.js.map +0 -0
- /package/dist/{components/wizard/category-grid.js.map → load-agent-defs-YMDWBFDP.js.map} +0 -0
- /package/dist/{components/wizard/checkbox-grid.js.map → recompile-project-agents-SZ76WNTW.js.map} +0 -0
- /package/dist/{components/wizard/domain-selection.js.map → source-loader-C5SQXZXI.js.map} +0 -0
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SelectList
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-44TE3RKH.js";
|
|
5
5
|
import {
|
|
6
6
|
holdInstalledGlobal,
|
|
7
7
|
installPlanLines,
|
|
8
8
|
notInstalledGlobally,
|
|
9
9
|
openUrl,
|
|
10
10
|
readInstalledGlobal
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
runWizardSession
|
|
14
|
-
} from "./chunk-HHIYT3PI.js";
|
|
15
|
-
import {
|
|
16
|
-
useTerminalDimensions
|
|
17
|
-
} from "./chunk-4NDBUJHK.js";
|
|
18
|
-
import {
|
|
19
|
-
awaitUnderSpinner
|
|
20
|
-
} from "./chunk-VRXX4D6K.js";
|
|
11
|
+
} from "./chunk-6HNXYYVF.js";
|
|
21
12
|
import {
|
|
22
13
|
fetchSeedConfig
|
|
23
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OYJQUA3D.js";
|
|
24
15
|
import {
|
|
25
16
|
promptConfirm,
|
|
26
17
|
promptValue
|
|
@@ -30,7 +21,7 @@ import {
|
|
|
30
21
|
} from "./chunk-OZXAJNLA.js";
|
|
31
22
|
import {
|
|
32
23
|
hostCompileNotices
|
|
33
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F5EBEATU.js";
|
|
34
25
|
import {
|
|
35
26
|
compileAgentsAllScopes,
|
|
36
27
|
compileProjectScope,
|
|
@@ -38,14 +29,14 @@ import {
|
|
|
38
29
|
movedGlobalAgentInputs,
|
|
39
30
|
sayCapturedWarnings,
|
|
40
31
|
writeProjectConfig
|
|
41
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-7RDMTR64.js";
|
|
42
33
|
import {
|
|
43
34
|
copyLocalSkills,
|
|
44
35
|
discoverInstalledSkills
|
|
45
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-F2BHT5C4.js";
|
|
46
37
|
import {
|
|
47
38
|
loadAgentDefs
|
|
48
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-HED2DAXZ.js";
|
|
49
40
|
import {
|
|
50
41
|
render
|
|
51
42
|
} from "./chunk-JFLVEFFP.js";
|
|
@@ -53,22 +44,21 @@ import {
|
|
|
53
44
|
providerFlag,
|
|
54
45
|
providerNamedBy,
|
|
55
46
|
providerNeedsAConfigurationToInstall
|
|
56
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-RIPSGNLU.js";
|
|
57
48
|
import {
|
|
58
49
|
BaseCommand,
|
|
59
50
|
EXIT_CODES,
|
|
51
|
+
clearTerminalScreen,
|
|
60
52
|
registerExternalSkills,
|
|
61
53
|
writeExternalSkills
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import {
|
|
64
|
-
clearTerminalScreen
|
|
65
|
-
} from "./chunk-RZDXDMT6.js";
|
|
54
|
+
} from "./chunk-V3KTSP3Q.js";
|
|
66
55
|
import {
|
|
67
56
|
INCOMPLETE_WORK_RECOVERY,
|
|
68
57
|
INSTALL_MODE_DESCRIPTIONS,
|
|
69
58
|
INSTALL_MODE_LABELS,
|
|
70
59
|
SHARED_CONFIG_ARRIVALS,
|
|
71
60
|
STATUS_MESSAGES,
|
|
61
|
+
addMarketplaceInTheEditor,
|
|
72
62
|
advisesOnPermissions,
|
|
73
63
|
agentCodec,
|
|
74
64
|
agentsNotCompiled,
|
|
@@ -79,7 +69,6 @@ import {
|
|
|
79
69
|
deriveInstallMode,
|
|
80
70
|
detectInstallation,
|
|
81
71
|
detectProjectInstallation,
|
|
82
|
-
editorLoadsItsOwnMarketplace,
|
|
83
72
|
fileExists,
|
|
84
73
|
getErrorMessage,
|
|
85
74
|
getInstallationInfo,
|
|
@@ -89,10 +78,9 @@ import {
|
|
|
89
78
|
initSucceeded,
|
|
90
79
|
installBaseDir,
|
|
91
80
|
isHomeDirectory,
|
|
92
|
-
|
|
81
|
+
isLocalSource,
|
|
93
82
|
keptAsInstalledGlobally,
|
|
94
83
|
loadProjectConfig,
|
|
95
|
-
marketplaceFixedAtInstall,
|
|
96
84
|
permissionFiles,
|
|
97
85
|
plural,
|
|
98
86
|
providerInUse,
|
|
@@ -100,33 +88,55 @@ import {
|
|
|
100
88
|
relativeConfigPath,
|
|
101
89
|
resolveBranding,
|
|
102
90
|
resolveInstallPaths,
|
|
103
|
-
|
|
104
|
-
seedToWizardResult,
|
|
91
|
+
seedToInstallSelection,
|
|
105
92
|
settingsFileSchema,
|
|
106
93
|
sharedConfigExistingInstall,
|
|
107
94
|
skippedUnknownAgents,
|
|
108
95
|
skippedUnknownSkills,
|
|
109
|
-
warn
|
|
110
|
-
|
|
111
|
-
} from "./chunk-A4KDXNOT.js";
|
|
96
|
+
warn
|
|
97
|
+
} from "./chunk-MQ6CGZNJ.js";
|
|
112
98
|
import {
|
|
113
99
|
ASCII_LOGO,
|
|
114
100
|
CLI_COLORS,
|
|
115
101
|
CLI_INVOKE_COMMAND,
|
|
116
102
|
DEFAULT_BRANDING,
|
|
117
103
|
EDITOR_URL,
|
|
118
|
-
EDIT_PROJECT_SETUP_FLAG,
|
|
119
|
-
EDIT_PROJECT_SETUP_MARKETPLACE_FLAG,
|
|
120
104
|
EJECT_SOURCE,
|
|
121
105
|
MAX_CONFIG_FILE_SIZE,
|
|
122
106
|
editorConfigUrl
|
|
123
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-PJWGTNOX.js";
|
|
124
108
|
|
|
125
109
|
// src/cli/commands/init.tsx
|
|
126
110
|
import "react";
|
|
127
111
|
import { Flags } from "@oclif/core";
|
|
128
112
|
import { Box as Box2, Text as Text2, useApp } from "ink";
|
|
129
113
|
|
|
114
|
+
// src/cli/components/hooks/use-terminal-dimensions.ts
|
|
115
|
+
import { useState, useEffect } from "react";
|
|
116
|
+
import { useStdout } from "ink";
|
|
117
|
+
var DEFAULT_COLUMNS = 80;
|
|
118
|
+
var DEFAULT_ROWS = 24;
|
|
119
|
+
function useTerminalDimensions() {
|
|
120
|
+
const { stdout } = useStdout();
|
|
121
|
+
const [dimensions, setDimensions] = useState(() => ({
|
|
122
|
+
columns: stdout.columns || DEFAULT_COLUMNS,
|
|
123
|
+
rows: stdout.rows || DEFAULT_ROWS
|
|
124
|
+
}));
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
const handleResize = () => {
|
|
127
|
+
setDimensions({
|
|
128
|
+
columns: stdout.columns || DEFAULT_COLUMNS,
|
|
129
|
+
rows: stdout.rows || DEFAULT_ROWS
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
stdout.on("resize", handleResize);
|
|
133
|
+
return () => {
|
|
134
|
+
stdout.off("resize", handleResize);
|
|
135
|
+
};
|
|
136
|
+
}, [stdout]);
|
|
137
|
+
return dimensions;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
// src/cli/lib/permission-checker.tsx
|
|
131
141
|
import "react";
|
|
132
142
|
import "zod";
|
|
@@ -209,11 +219,12 @@ async function checkPermissions(projectRoot) {
|
|
|
209
219
|
// src/cli/commands/init.tsx
|
|
210
220
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
211
221
|
var DASHBOARD_OPTIONS = [
|
|
212
|
-
{ label: "Edit", value: "edit" },
|
|
222
|
+
{ label: "Edit in the web editor", value: "edit" },
|
|
213
223
|
{ label: "Compile", value: "compile" },
|
|
214
224
|
{ label: "Doctor", value: "doctor" },
|
|
215
225
|
{ label: "List", value: "list" }
|
|
216
226
|
];
|
|
227
|
+
var DASHBOARD_OPTIONS_LINE = ` ${DASHBOARD_OPTIONS.map(({ label }) => `[${label}]`).join(" ")}`;
|
|
217
228
|
var DashboardTitle = ({ name }) => name === DEFAULT_BRANDING.NAME ? /* @__PURE__ */ jsx2(Text2, { children: ASCII_LOGO }) : /* @__PURE__ */ jsx2(Text2, { bold: true, children: name });
|
|
218
229
|
var Dashboard = ({ data, onSelect, onCancel }) => {
|
|
219
230
|
const { exit } = useApp();
|
|
@@ -249,13 +260,7 @@ function dashboardCountLines(data) {
|
|
|
249
260
|
return lines;
|
|
250
261
|
}
|
|
251
262
|
function formatDashboardText(data) {
|
|
252
|
-
return [
|
|
253
|
-
data.name,
|
|
254
|
-
"",
|
|
255
|
-
...dashboardCountLines(data),
|
|
256
|
-
"",
|
|
257
|
-
` [Edit] [Compile] [Doctor] [List]`
|
|
258
|
-
].join("\n");
|
|
263
|
+
return [data.name, "", ...dashboardCountLines(data), "", DASHBOARD_OPTIONS_LINE].join("\n");
|
|
259
264
|
}
|
|
260
265
|
var DASHBOARD_INTERRUPTED = "interrupted";
|
|
261
266
|
async function showDashboard(projectDir, log) {
|
|
@@ -279,21 +284,16 @@ async function showDashboard(projectDir, log) {
|
|
|
279
284
|
clearTerminalScreen();
|
|
280
285
|
return selectedCommand;
|
|
281
286
|
}
|
|
282
|
-
function dashboardCommandArgv(command
|
|
283
|
-
|
|
284
|
-
const marketplaceArgv = setupMarketplace === void 0 ? [] : [`--${EDIT_PROJECT_SETUP_MARKETPLACE_FLAG}`, setupMarketplace];
|
|
285
|
-
return [`--${EDIT_PROJECT_SETUP_FLAG}`, ...marketplaceArgv];
|
|
287
|
+
function dashboardCommandArgv(command) {
|
|
288
|
+
return command === "edit" ? ["--ui"] : [];
|
|
286
289
|
}
|
|
287
|
-
async function runDashboardFlow(projectDir, config,
|
|
290
|
+
async function runDashboardFlow(projectDir, config, log) {
|
|
288
291
|
const installation = await detectInstallation(projectDir);
|
|
289
292
|
if (!installation) return "not-installed";
|
|
290
293
|
const selectedCommand = await showDashboard(projectDir, log);
|
|
291
294
|
if (selectedCommand === DASHBOARD_INTERRUPTED) return "cancelled";
|
|
292
295
|
if (selectedCommand) {
|
|
293
|
-
await config.runCommand(
|
|
294
|
-
selectedCommand,
|
|
295
|
-
dashboardCommandArgv(selectedCommand, origin, setupMarketplace)
|
|
296
|
-
);
|
|
296
|
+
await config.runCommand(selectedCommand, dashboardCommandArgv(selectedCommand));
|
|
297
297
|
}
|
|
298
298
|
return "shown";
|
|
299
299
|
}
|
|
@@ -309,29 +309,33 @@ var Init = class _Init extends BaseCommand {
|
|
|
309
309
|
*/
|
|
310
310
|
brandingName = DEFAULT_BRANDING.NAME;
|
|
311
311
|
static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;
|
|
312
|
-
static description = "
|
|
312
|
+
static description = "Build a configuration in agentsinc.sh/editor, or install one by id with --from. Over an existing installation, shows its dashboard.";
|
|
313
313
|
static examples = [
|
|
314
314
|
{
|
|
315
|
-
description: "
|
|
315
|
+
description: "Open the editor to build a configuration",
|
|
316
316
|
command: "<%= config.bin %> <%= command.id %>"
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
|
-
description: "
|
|
320
|
-
command: "<%= config.bin %> <%= command.id %> --
|
|
319
|
+
description: "Install a configuration built in the editor",
|
|
320
|
+
command: "<%= config.bin %> <%= command.id %> --from <id>"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
description: "Test local marketplace changes against a configuration built in the editor",
|
|
324
|
+
command: "<%= config.bin %> <%= command.id %> --from <id> --marketplace ./my-marketplace"
|
|
321
325
|
}
|
|
322
326
|
];
|
|
323
327
|
static flags = {
|
|
324
328
|
marketplace: Flags.string({
|
|
325
329
|
char: "m",
|
|
326
|
-
description: "
|
|
330
|
+
description: "With --from, install from this marketplace instead of the one the configuration names. Without --from, open the editor and say how to add it there",
|
|
327
331
|
required: false
|
|
328
332
|
}),
|
|
329
333
|
from: Flags.string({
|
|
330
|
-
description: "Install a configuration shared from agentsinc.sh by its id
|
|
334
|
+
description: "Install a configuration shared from agentsinc.sh by its id",
|
|
331
335
|
helpValue: "<id>"
|
|
332
336
|
}),
|
|
333
337
|
ui: Flags.boolean({
|
|
334
|
-
description: "Open agentsinc.sh/editor
|
|
338
|
+
description: "Open agentsinc.sh/editor on the id --from names, or on the catalogue \u2014 what a bare init does where nothing is installed",
|
|
335
339
|
default: false
|
|
336
340
|
}),
|
|
337
341
|
provider: providerFlag()
|
|
@@ -366,47 +370,51 @@ var Init = class _Init extends BaseCommand {
|
|
|
366
370
|
* desktop session there is no browser to be anybody's — a link nobody can copy is the whole
|
|
367
371
|
* loss, so opening one is the convenience on top and a failure to open is a warning beside a
|
|
368
372
|
* link that still works.
|
|
373
|
+
*
|
|
374
|
+
* A marketplace named here cannot ride along: the address carries an id and nothing else, so
|
|
375
|
+
* the line under the link says how to add it in the editor.
|
|
369
376
|
*/
|
|
370
|
-
async openEditor(id,
|
|
377
|
+
async openEditor(projectDir, id, marketplace) {
|
|
371
378
|
const url = id === void 0 ? EDITOR_URL : editorConfigUrl(id);
|
|
379
|
+
const marketplaceLine = marketplace === void 0 ? void 0 : this.addMarketplaceLineOrFail(marketplace);
|
|
372
380
|
this.log(id === void 0 ? `Build it at ${url}` : `Open it at ${url}`);
|
|
381
|
+
if (marketplaceLine !== void 0) this.log(marketplaceLine);
|
|
373
382
|
this.log(applySharedConfigHere(id, await holdsItsOwnInstallation(projectDir)));
|
|
374
383
|
if (!process.stdin.isTTY) return;
|
|
375
384
|
const opened = await openUrl(url);
|
|
376
385
|
if (!opened.ok) this.warn(opened.error);
|
|
377
386
|
}
|
|
378
387
|
/**
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* `--from` asks a question the wizard does not, and every refusal it makes comes before it.
|
|
388
|
+
* Every route `init` has, in the order they are tried: the editor for `--ui` and for a
|
|
389
|
+
* marketplace named without `--from`; for a bare run, the installation's dashboard — or the
|
|
390
|
+
* editor where nothing is installed; and the install of the configuration `--from` names.
|
|
383
391
|
*/
|
|
384
392
|
async install() {
|
|
385
393
|
const { flags } = await this.parse(_Init);
|
|
386
394
|
const projectDir = process.cwd();
|
|
387
395
|
this.settleTheProviderForThisRun(flags);
|
|
388
|
-
if (flags.
|
|
389
|
-
this.refuseMarketplaceForTheEditor(flags.marketplace);
|
|
390
|
-
return this.openEditor(flags.from, projectDir);
|
|
391
|
-
}
|
|
396
|
+
if (opensTheEditor(flags)) return this.openEditor(projectDir, flags.from, flags.marketplace);
|
|
392
397
|
await this.ensureConfigReadable(projectDir);
|
|
398
|
+
if (flags.from === void 0) return this.showDashboardOrOpenEditor(projectDir);
|
|
393
399
|
this.brandingName = await this.resolveBrandingName(projectDir);
|
|
394
|
-
|
|
395
|
-
await this.refuseMarketplaceOtherThanTheInstalledOne(projectDir, flags.marketplace);
|
|
396
|
-
const dashboard = await this.showDashboardIfInitialized(projectDir, flags.marketplace);
|
|
397
|
-
if (dashboard === "cancelled") this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
|
|
398
|
-
if (dashboard === "shown") return;
|
|
399
|
-
}
|
|
400
|
-
const selection = flags.from ? await this.selectionFromSharedConfig(flags.from, flags, projectDir) : await this.selectionFromWizard(flags, projectDir);
|
|
400
|
+
const selection = await this.selectionFromSharedConfig(flags.from, flags, projectDir);
|
|
401
401
|
if (!selection) this.exit(EXIT_CODES.CANCELLED);
|
|
402
402
|
this.reportValidationErrors(selection.result.validation);
|
|
403
|
-
await this.handleInstallation(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
);
|
|
403
|
+
await this.handleInstallation(selection);
|
|
404
|
+
}
|
|
405
|
+
/** A bare `init`: the installation's dashboard, or the editor where nothing is installed. */
|
|
406
|
+
async showDashboardOrOpenEditor(projectDir) {
|
|
407
|
+
const dashboard = await runDashboardFlow(projectDir, this.config, (msg) => this.log(msg));
|
|
408
|
+
if (dashboard === "cancelled") this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
|
|
409
|
+
if (dashboard === "not-installed") await this.openEditor(projectDir);
|
|
410
|
+
}
|
|
411
|
+
/** The editor's marketplace line, or the refusal the install route gives a ref it cannot read. */
|
|
412
|
+
addMarketplaceLineOrFail(ref) {
|
|
413
|
+
try {
|
|
414
|
+
return addMarketplaceInTheEditor(ref, isLocalSource(ref));
|
|
415
|
+
} catch (error) {
|
|
416
|
+
this.handleError(error);
|
|
417
|
+
}
|
|
410
418
|
}
|
|
411
419
|
/**
|
|
412
420
|
* Commits this run to the provider `--provider` named, or refuses a flag with nothing to name.
|
|
@@ -417,11 +425,9 @@ var Init = class _Init extends BaseCommand {
|
|
|
417
425
|
* "the flag selects an installation" would be indistinguishable from "the flag means Codex".
|
|
418
426
|
*
|
|
419
427
|
* **And it is meaningless without `--from` (D15).** The provider is chosen in the web app, so
|
|
420
|
-
* the only run that can be told one is the run that installs what the app produced.
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
* something to refuse BEFORE anything is written: with `--from` required, a provider always
|
|
424
|
-
* arrives beside a payload the pre-flight can read.
|
|
428
|
+
* the only run that can be told one is the run that installs what the app produced. It also
|
|
429
|
+
* gives the placement refusal something to refuse BEFORE anything is written: with `--from`
|
|
430
|
+
* required, a provider always arrives beside a payload the pre-flight can read.
|
|
425
431
|
*/
|
|
426
432
|
settleTheProviderForThisRun(flags) {
|
|
427
433
|
const named = providerNamedBy(flags.provider);
|
|
@@ -431,35 +437,8 @@ var Init = class _Init extends BaseCommand {
|
|
|
431
437
|
}
|
|
432
438
|
chooseProviderForThisRun(named);
|
|
433
439
|
}
|
|
434
|
-
/** The interactive producer: load the source, run the wizard, return what was chosen. */
|
|
435
|
-
async selectionFromWizard(flags, projectDir) {
|
|
436
|
-
const isGlobalRoot = isHomeDirectory(projectDir);
|
|
437
|
-
const { sourceResult, startupMessages } = await this.loadWizardInputsUnderSpinner(flags);
|
|
438
|
-
if (!process.stdin.isTTY) {
|
|
439
|
-
this.error(wizardNeedsTerminal("init"), { exit: EXIT_CODES.ERROR });
|
|
440
|
-
}
|
|
441
|
-
const result = await this.runWizard(startupMessages, isGlobalRoot);
|
|
442
|
-
if (!result) return null;
|
|
443
|
-
if (selectsNothing(result)) this.error("No skills selected", { exit: EXIT_CODES.ERROR });
|
|
444
|
-
return {
|
|
445
|
-
result,
|
|
446
|
-
sourceResult,
|
|
447
|
-
sourceFlags: flags,
|
|
448
|
-
// A person is already at the terminal, so the permission notice can wait for them.
|
|
449
|
-
interactive: true,
|
|
450
|
-
// The wizard opens only where nothing is installed at all — see `runWizard`.
|
|
451
|
-
installedAlready: /* @__PURE__ */ new Set()
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
440
|
/**
|
|
455
|
-
*
|
|
456
|
-
* await ends — a source that cannot be loaded refuses the run from inside it.
|
|
457
|
-
*/
|
|
458
|
-
async loadWizardInputsUnderSpinner(flags) {
|
|
459
|
-
return awaitUnderSpinner(STATUS_MESSAGES.LOADING_SKILLS, () => this.loadSourceOrFail(flags));
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* The `--from <id>` producer: fetch and map, no wizard — and, at a terminal, one question.
|
|
441
|
+
* The `--from <id>` producer: fetch and map — and, at a terminal, one question.
|
|
463
442
|
*
|
|
464
443
|
* It installs into a clean directory, which is what the first refusal is: a shared
|
|
465
444
|
* configuration is installed whole, so a directory already holding one has it applied with
|
|
@@ -530,14 +509,13 @@ var Init = class _Init extends BaseCommand {
|
|
|
530
509
|
result: held.result,
|
|
531
510
|
sourceResult,
|
|
532
511
|
sourceFlags,
|
|
533
|
-
interactive: false,
|
|
534
512
|
installedAlready: new Set(held.installed.skillIds)
|
|
535
513
|
};
|
|
536
514
|
}
|
|
537
515
|
/**
|
|
538
516
|
* The two lists — what goes into this project, and what into the global install — then the
|
|
539
|
-
* global skills skipped as already installed,
|
|
540
|
-
* otherwise than they are installed, which stay.
|
|
517
|
+
* global skills skipped as already installed, the held sub-agents a new skill joins, and the
|
|
518
|
+
* global entries the configuration states otherwise than they are installed, which stay.
|
|
541
519
|
*/
|
|
542
520
|
logWhatGoesWhere(held) {
|
|
543
521
|
for (const line of installPlanLines(held)) {
|
|
@@ -579,13 +557,13 @@ var Init = class _Init extends BaseCommand {
|
|
|
579
557
|
});
|
|
580
558
|
}
|
|
581
559
|
/**
|
|
582
|
-
* The decode refuses a payload the config model has nowhere to write (see
|
|
583
|
-
* That is a failure of this command, reported with this command's exit
|
|
584
|
-
* surface as an unhandled throw.
|
|
560
|
+
* The decode refuses a payload the config model has nowhere to write (see
|
|
561
|
+
* `seedToInstallSelection`). That is a failure of this command, reported with this command's exit
|
|
562
|
+
* code rather than left to surface as an unhandled throw.
|
|
585
563
|
*/
|
|
586
564
|
decodeSeedOrFail(payload, matrix) {
|
|
587
565
|
try {
|
|
588
|
-
return
|
|
566
|
+
return seedToInstallSelection(payload, matrix);
|
|
589
567
|
} catch (error) {
|
|
590
568
|
this.handleError(error);
|
|
591
569
|
}
|
|
@@ -611,46 +589,6 @@ var Init = class _Init extends BaseCommand {
|
|
|
611
589
|
await writeExternalSkills(carried);
|
|
612
590
|
this.log(carriedSkillsWritten(carried.map((skill) => skill.id)));
|
|
613
591
|
}
|
|
614
|
-
async showDashboardIfInitialized(projectDir, setupMarketplace) {
|
|
615
|
-
return runDashboardFlow(
|
|
616
|
-
projectDir,
|
|
617
|
-
this.config,
|
|
618
|
-
"init",
|
|
619
|
-
(msg) => this.log(msg),
|
|
620
|
-
setupMarketplace
|
|
621
|
-
);
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Refuses `--marketplace` beside `--ui`. The editor's address carries a configuration id and
|
|
625
|
-
* nothing else, so the marketplace would be dropped on the way — and the editor loads
|
|
626
|
-
* marketplaces itself.
|
|
627
|
-
*/
|
|
628
|
-
refuseMarketplaceForTheEditor(named) {
|
|
629
|
-
if (named === void 0) return;
|
|
630
|
-
this.error(editorLoadsItsOwnMarketplace(named), { exit: EXIT_CODES.INVALID_ARGS });
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* Refuses a marketplace other than the one this folder's OWN installation was made from.
|
|
634
|
-
*
|
|
635
|
-
* An installation's marketplace is chosen once, when it is made, and the dashboard every route
|
|
636
|
-
* here ends on reads the one it stored — so naming another would be dropped, and a flag dropped
|
|
637
|
-
* reads as honoured. Project-scoped detection, because a project with no installation of its
|
|
638
|
-
* own is not refused for the global one above it: that is two installations, and the setup the
|
|
639
|
-
* dashboard's Edit runs there takes the named marketplace. At the home directory the folder's
|
|
640
|
-
* own installation IS the global one, and the same detection finds it.
|
|
641
|
-
*
|
|
642
|
-
* The stored marketplace is resolved the way every later command resolves it — this folder's
|
|
643
|
-
* config, then the global one, then the default — so an installation that recorded none is
|
|
644
|
-
* held to the one it has actually been reading. A folder named back by another spelling of its
|
|
645
|
-
* path is that same marketplace.
|
|
646
|
-
*/
|
|
647
|
-
async refuseMarketplaceOtherThanTheInstalledOne(projectDir, named) {
|
|
648
|
-
if (named === void 0) return;
|
|
649
|
-
if (!await detectProjectInstallation(projectDir)) return;
|
|
650
|
-
const { source: stored } = await resolveSource({ caller: "stored", projectDir });
|
|
651
|
-
if (isSameMarketplace(named, stored, projectDir)) return;
|
|
652
|
-
this.error(marketplaceFixedAtInstall(stored, named), { exit: EXIT_CODES.INVALID_ARGS });
|
|
653
|
-
}
|
|
654
592
|
async loadSourceOrFail(flags) {
|
|
655
593
|
try {
|
|
656
594
|
const loaded = await loadSource({
|
|
@@ -667,33 +605,18 @@ var Init = class _Init extends BaseCommand {
|
|
|
667
605
|
});
|
|
668
606
|
}
|
|
669
607
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
*/
|
|
677
|
-
async runWizard(startupMessages, isGlobalRoot) {
|
|
678
|
-
return runWizardSession({
|
|
679
|
-
hydrate: { isEditingFromGlobalScope: isGlobalRoot },
|
|
680
|
-
props: {
|
|
681
|
-
version: this.config.version,
|
|
682
|
-
logo: ASCII_LOGO,
|
|
683
|
-
startupMessages
|
|
684
|
-
},
|
|
685
|
-
onCancel: () => this.log("Setup cancelled"),
|
|
686
|
-
clearTerminal: () => this.clearTerminal()
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
async handleInstallation(result, sourceResult, flags, interactive, installedAlready) {
|
|
608
|
+
async handleInstallation({
|
|
609
|
+
result,
|
|
610
|
+
sourceResult,
|
|
611
|
+
sourceFlags,
|
|
612
|
+
installedAlready
|
|
613
|
+
}) {
|
|
690
614
|
const projectDir = process.cwd();
|
|
691
615
|
const activeSkills = result.skills.filter((s) => !s.excluded);
|
|
692
616
|
const toInstall = activeSkills.filter((s) => !installedAlready.has(s.id));
|
|
693
617
|
const installMode = deriveInstallMode(toInstall);
|
|
694
618
|
const ejectedSkills = toInstall.filter((s) => s.origin === EJECT_SOURCE);
|
|
695
619
|
const pluginSkills = toInstall.filter((s) => s.origin !== EJECT_SOURCE);
|
|
696
|
-
this.refuseUnofferablePlacementsBeforeWriting(activeSkills, projectDir);
|
|
697
620
|
this.logInstallPlan(installMode, ejectedSkills, pluginSkills);
|
|
698
621
|
const resolvedMarketplace = pluginSkills.length > 0 ? await this.requireMarketplaceOrExit(
|
|
699
622
|
sourceResult,
|
|
@@ -715,7 +638,7 @@ var Init = class _Init extends BaseCommand {
|
|
|
715
638
|
const { configResult, compileResult, agentScopeMap } = await this.writeConfigAndCompile(
|
|
716
639
|
result,
|
|
717
640
|
sourceResult,
|
|
718
|
-
|
|
641
|
+
sourceFlags
|
|
719
642
|
);
|
|
720
643
|
this.reportSuccess(
|
|
721
644
|
configResult,
|
|
@@ -725,28 +648,21 @@ var Init = class _Init extends BaseCommand {
|
|
|
725
648
|
pluginModeSucceeded,
|
|
726
649
|
copyResult
|
|
727
650
|
);
|
|
728
|
-
await this.showPermissionNotice(projectDir
|
|
651
|
+
await this.showPermissionNotice(projectDir);
|
|
729
652
|
} catch (error) {
|
|
730
653
|
this.handleError(error);
|
|
731
654
|
}
|
|
732
655
|
}
|
|
733
656
|
/**
|
|
734
657
|
* The permission notice, where there is one to show. It is an Ink app with no exit of its own,
|
|
735
|
-
* so
|
|
736
|
-
*
|
|
737
|
-
* rendered and let go: the notice is information, not a prompt, so there is nothing to answer
|
|
738
|
-
* and nothing to wait for.
|
|
658
|
+
* so one frame is rendered and let go: the notice is information, not a prompt, and `--from`
|
|
659
|
+
* has to complete over a pipe and in CI.
|
|
739
660
|
*/
|
|
740
|
-
async showPermissionNotice(projectDir
|
|
661
|
+
async showPermissionNotice(projectDir) {
|
|
741
662
|
const permissionWarning = await checkPermissions(projectDir);
|
|
742
663
|
if (!permissionWarning) return;
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
unmount();
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
const { waitUntilExit } = render(permissionWarning);
|
|
749
|
-
await waitUntilExit();
|
|
664
|
+
const { unmount } = render(permissionWarning);
|
|
665
|
+
unmount();
|
|
750
666
|
}
|
|
751
667
|
logInstallPlan(installMode, ejectedSkills, pluginSkills) {
|
|
752
668
|
this.log("\n");
|
|
@@ -768,7 +684,7 @@ var Init = class _Init extends BaseCommand {
|
|
|
768
684
|
async writeConfigAndCompile(result, sourceResult, flags) {
|
|
769
685
|
this.log("Generating configuration...");
|
|
770
686
|
const configResult = await writeProjectConfig({
|
|
771
|
-
|
|
687
|
+
selection: result,
|
|
772
688
|
sourceResult,
|
|
773
689
|
projectDir: process.cwd(),
|
|
774
690
|
...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace }
|
|
@@ -943,6 +859,9 @@ var Init = class _Init extends BaseCommand {
|
|
|
943
859
|
}
|
|
944
860
|
}
|
|
945
861
|
};
|
|
862
|
+
function opensTheEditor(flags) {
|
|
863
|
+
return flags.ui || flags.from === void 0 && flags.marketplace !== void 0;
|
|
864
|
+
}
|
|
946
865
|
function selectsNothing(result) {
|
|
947
866
|
return result.skills.length === 0 && result.selectedAgents.length === 0;
|
|
948
867
|
}
|
|
@@ -1021,4 +940,4 @@ export {
|
|
|
1021
940
|
Init,
|
|
1022
941
|
getDashboardData
|
|
1023
942
|
};
|
|
1024
|
-
//# sourceMappingURL=chunk-
|
|
943
|
+
//# sourceMappingURL=chunk-NCWDK6L7.js.map
|