@cimplify/cli 0.15.3 → 0.16.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/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/add-SXC6RUPQ.mjs +140 -0
- package/dist/{add-KRIIKAS4.mjs → add-XQVQLD3F.mjs} +4 -4
- package/dist/ai-NQH5L4I6.mjs +17 -0
- package/dist/{assets-CWB72PZG.mjs → assets-FZGVOQXH.mjs} +12 -7
- package/dist/{auth-step-up-Z6KOTTV7.mjs → auth-step-up-67LCPDNL.mjs} +5 -5
- package/dist/build-J4ZUIOPX.mjs +625 -0
- package/dist/{cancel-ZHVVILOU.mjs → cancel-VGJHZJ4J.mjs} +4 -4
- package/dist/capture-RAJ2B3BH.mjs +69 -0
- package/dist/chunk-25ZPFHLF.mjs +51 -0
- package/dist/chunk-47ZXSY47.mjs +52 -0
- package/dist/{chunk-O2TO2J4I.mjs → chunk-54J3XR4T.mjs} +2 -2
- package/dist/chunk-5HP2INMY.mjs +10631 -0
- package/dist/chunk-7JR6JCFF.mjs +32 -0
- package/dist/chunk-7PQL7E7K.mjs +68 -0
- package/dist/chunk-AKACUJ3W.mjs +81 -0
- package/dist/chunk-BYNE553A.mjs +2945 -0
- package/dist/{chunk-NYXA6X56.mjs → chunk-CLQYPTJ2.mjs} +31 -11
- package/dist/chunk-CNZAOVSK.mjs +104 -0
- package/dist/chunk-CPBESPWK.mjs +5576 -0
- package/dist/{chunk-3RPR33MO.mjs → chunk-DYWUPHV3.mjs} +11 -7
- package/dist/chunk-EAV2P4N3.mjs +1941 -0
- package/dist/{chunk-UTD34C2H.mjs → chunk-EDZSOL5O.mjs} +2 -4
- package/dist/chunk-EGQIPYUN.mjs +696 -0
- package/dist/{chunk-DMLQBAGC.mjs → chunk-EOO4UOQD.mjs} +1 -1
- package/dist/chunk-EYEMPIMP.mjs +74 -0
- package/dist/chunk-G2ZEFSQJ.mjs +46 -0
- package/dist/{chunk-TH4XENKH.mjs → chunk-I4HNHPEM.mjs} +1 -1
- package/dist/chunk-JEVSFNPT.mjs +363 -0
- package/dist/chunk-JKECUAAV.mjs +2169 -0
- package/dist/chunk-KMHORI4Y.mjs +638 -0
- package/dist/chunk-KNPYBZ6B.mjs +502 -0
- package/dist/{chunk-3QUK5BPY.mjs → chunk-KOD4GBQ5.mjs} +8 -1
- package/dist/chunk-KQNZKV6E.mjs +535 -0
- package/dist/{chunk-2MKZKUVH.mjs → chunk-LLRUOIMU.mjs} +1 -2
- package/dist/{chunk-OLZKNUMK.mjs → chunk-LNMITJ4Z.mjs} +6 -6
- package/dist/chunk-MEM3MDV4.mjs +6463 -0
- package/dist/chunk-NY4YT7O6.mjs +84 -0
- package/dist/{chunk-LZEG3FEY.mjs → chunk-Q6CF4C3E.mjs} +7 -7
- package/dist/chunk-RP66A52P.mjs +86 -0
- package/dist/{chunk-I2UP7YTG.mjs → chunk-SAXGWS2K.mjs} +1 -1
- package/dist/chunk-SCKQ4XSD.mjs +41 -0
- package/dist/chunk-SF44L2OD.mjs +1152 -0
- package/dist/chunk-SGT5IJVW.mjs +28 -0
- package/dist/{chunk-LJEKKFC7.mjs → chunk-SS4JTMIV.mjs} +8 -8
- package/dist/chunk-T4MW3PD4.mjs +1456 -0
- package/dist/chunk-THATLMEX.mjs +1227 -0
- package/dist/{chunk-MLE4MVYC.mjs → chunk-TT4YI33G.mjs} +2 -2
- package/dist/chunk-TYV2SVFN.mjs +101 -0
- package/dist/chunk-VHK7WBO3.mjs +189 -0
- package/dist/chunk-VSA44UKR.mjs +391 -0
- package/dist/chunk-XL54SQJ3.mjs +42 -0
- package/dist/{chunk-5KYR6WJB.mjs → chunk-XQAHREKO.mjs} +17 -1
- package/dist/chunk-ZUCDXRFI.mjs +2011 -0
- package/dist/create-4S2EAUR3.mjs +10 -0
- package/dist/credits-NJOAOPPW.mjs +33 -0
- package/dist/{deploy-STWZ3OSM.mjs → deploy-26Y4UGZZ.mjs} +11 -11
- package/dist/dev-MOYURRWQ.mjs +401 -0
- package/dist/dev-WL43Q7VD.mjs +8 -0
- package/dist/dispatcher.mjs +131 -30
- package/dist/{doctor-3RW3OGZJ.mjs → doctor-E6ETD2GJ.mjs} +12 -20
- package/dist/{domains-FTNK4IKY.mjs → domains-LOTQMVOR.mjs} +6 -6
- package/dist/engine-runtime-fetch-CIE7S7PB.mjs +10 -0
- package/dist/{env-TNCYUAMT.mjs → env-3PDFC5XF.mjs} +7 -7
- package/dist/env-MOTYOPM5.mjs +19 -0
- package/dist/explain-K5QEVWCD.mjs +251 -0
- package/dist/{inspect-X3M7WSTL.mjs → inspect-Q3E2DHYY.mjs} +3 -3
- package/dist/inspect-SJ4WBAXO.mjs +86 -0
- package/dist/introspect-7F34YN5V.mjs +9 -0
- package/dist/kernel-DEGWMHFL.mjs +662 -0
- package/dist/kernel-plugin.js +6862 -0
- package/dist/keys-W5SN3DPK.mjs +71 -0
- package/dist/lines-XGJYTQ7P.mjs +56 -0
- package/dist/{link-76Z6V6CJ.mjs → link-NKUAVNM2.mjs} +6 -6
- package/dist/{lint-DDZ7HUQN.mjs → lint-G4YPQSSO.mjs} +2 -2
- package/dist/{list-2MFOQKKQ.mjs → list-TDR7K2JB.mjs} +3 -3
- package/dist/lock-EJPW2LM3.mjs +57 -0
- package/dist/{login-RLMDEWAL.mjs → login-AYLU7JU7.mjs} +10 -8
- package/dist/{logout-Z57X6HPE.mjs → logout-3M6VMHLH.mjs} +2 -2
- package/dist/{logs-TNDM4RFE.mjs → logs-4EL5SOXN.mjs} +5 -5
- package/dist/logs-4QQGG2XY.mjs +44 -0
- package/dist/mcp-4R2R6E5M.mjs +1077 -0
- package/dist/{mock-EVER34IX.mjs → mock-AK24GSP2.mjs} +2 -2
- package/dist/outdated-JEKCVLTG.mjs +58 -0
- package/dist/port-SBZ7X3EH.mjs +2408 -0
- package/dist/{projects-YL4T24VV.mjs → projects-7JKTC5WJ.mjs} +6 -6
- package/dist/publish-QQCX47HK.mjs +20 -0
- package/dist/remix-NLLYD3BI.mjs +125 -0
- package/dist/repo-Z4G4EW3N.mjs +9 -0
- package/dist/report-M7F4ZYP7.mjs +2 -0
- package/dist/rollback-2WQ2CW7T.mjs +43 -0
- package/dist/{rollback-47VQ4HJK.mjs → rollback-ZGU32HGT.mjs} +6 -6
- package/dist/scene-HXARHUM7.mjs +324 -0
- package/dist/{status-TWPOMWNA.mjs → status-C3ZSLZ7Q.mjs} +5 -5
- package/dist/status-WEQOC25K.mjs +18 -0
- package/dist/test-ZPBWV4VX.mjs +233 -0
- package/dist/testers-A3LMXOJJ.mjs +49 -0
- package/dist/{unlink-H3BO3DOQ.mjs → unlink-4G4FE4RJ.mjs} +2 -2
- package/dist/{update-FLY46XI3.mjs → update-GHKKM5FS.mjs} +4 -4
- package/dist/{whoami-CQPPARRS.mjs → whoami-3QQN6G2A.mjs} +3 -3
- package/dist/workshop-CD74D2LK.mjs +1703 -0
- package/package.json +11 -7
- package/templates/storefront-auto/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/package.json +1 -1
- package/dist/chunk-ARIDYKLO.mjs +0 -6463
- package/dist/dev-7O65HY6C.mjs +0 -8
- package/dist/explain-DLRUUCNS.mjs +0 -251
- package/dist/introspect-RC265ACF.mjs +0 -9
- package/dist/repo-UUT3AZ3L.mjs +0 -9
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { collectSourcePaths, listSourcePaths, buildLocal } from './chunk-CPBESPWK.mjs';
|
|
3
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-KOD4GBQ5.mjs';
|
|
4
|
+
import { existsSync, promises } from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { writablePath, readablePath, anthropicAuthoringModel, runAuthoringTurn } from '@cimplify/sdk/interactives/authoring';
|
|
7
|
+
|
|
8
|
+
var API_KEY_ENV = "ANTHROPIC_API_KEY";
|
|
9
|
+
var MODEL_ENV = "CIMPLIFY_AI_MODEL";
|
|
10
|
+
var MAX_HISTORY_MESSAGES = 80;
|
|
11
|
+
function inside(root, rel) {
|
|
12
|
+
const abs = path.resolve(root, ...rel.split("/"));
|
|
13
|
+
const base = path.resolve(root);
|
|
14
|
+
if (abs !== base && !abs.startsWith(base + path.sep)) throw new Error(`${rel} is outside the project`);
|
|
15
|
+
return abs;
|
|
16
|
+
}
|
|
17
|
+
function fileProject(root) {
|
|
18
|
+
return {
|
|
19
|
+
async list() {
|
|
20
|
+
const tracked = await collectSourcePaths(root);
|
|
21
|
+
const paths = tracked ?? (await listSourcePaths(root)).paths;
|
|
22
|
+
return [...paths].sort();
|
|
23
|
+
},
|
|
24
|
+
async read(rel) {
|
|
25
|
+
if (readablePath(rel) === null) return null;
|
|
26
|
+
try {
|
|
27
|
+
return await promises.readFile(inside(root, rel), "utf8");
|
|
28
|
+
} catch (err) {
|
|
29
|
+
if (err.code === "ENOENT" || err.code === "EISDIR") return null;
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
async write(rel, content) {
|
|
34
|
+
if (writablePath(rel) === null) throw new Error(`${rel} is not writable`);
|
|
35
|
+
const target = inside(root, rel);
|
|
36
|
+
await promises.mkdir(path.dirname(target), { recursive: true });
|
|
37
|
+
await promises.writeFile(target, content);
|
|
38
|
+
},
|
|
39
|
+
async remove(rel) {
|
|
40
|
+
if (writablePath(rel) === null) throw new Error(`${rel} is not writable`);
|
|
41
|
+
const target = inside(root, rel);
|
|
42
|
+
if (!existsSync(target)) return false;
|
|
43
|
+
await promises.rm(target);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function authoringDiagnostics(diagnostics) {
|
|
49
|
+
return diagnostics.map((d) => ({ severity: d.severity, code: d.code, message: d.message, file: d.file, line: d.line }));
|
|
50
|
+
}
|
|
51
|
+
function buildCheck(build) {
|
|
52
|
+
return async () => authoringDiagnostics((await build()).result.diagnostics);
|
|
53
|
+
}
|
|
54
|
+
function modelFromEnv(env = process.env) {
|
|
55
|
+
const apiKey = env[API_KEY_ENV];
|
|
56
|
+
if (apiKey === void 0 || apiKey.trim().length === 0) {
|
|
57
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `asking the AI to change an Interactive needs ${API_KEY_ENV}`, {
|
|
58
|
+
remediation: `Export ${API_KEY_ENV}=<your Anthropic API key> in the shell that runs cimplify, then try again. Set ${MODEL_ENV} to use a different model.`
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const model = env[MODEL_ENV]?.trim();
|
|
62
|
+
return anthropicAuthoringModel({ apiKey: apiKey.trim(), ...model ? { model } : {} });
|
|
63
|
+
}
|
|
64
|
+
function trimHistory(messages, limit = MAX_HISTORY_MESSAGES) {
|
|
65
|
+
if (messages.length <= limit) return [...messages];
|
|
66
|
+
for (let start = messages.length - limit; start < messages.length; start++) {
|
|
67
|
+
if (messages[start].role === "user") return messages.slice(start);
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
async function askAuthoring(root, request, options) {
|
|
72
|
+
const text = request.trim();
|
|
73
|
+
if (text.length === 0) throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, 'say what to change, for example: cimplify ai "add traffic to the loop"');
|
|
74
|
+
return runAuthoringTurn({
|
|
75
|
+
model: options.model,
|
|
76
|
+
project: fileProject(root),
|
|
77
|
+
check: options.check ?? buildCheck(() => buildLocal(root)),
|
|
78
|
+
request: text,
|
|
79
|
+
history: options.history,
|
|
80
|
+
onEvent: options.onEvent
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { askAuthoring, buildCheck, fileProject, modelFromEnv, trimHistory };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { promptYesNo } from './chunk-
|
|
3
|
-
import { gitRemoteHead, managedProviderForHost } from './chunk-
|
|
4
|
-
import { TOKEN_PURPOSE, REPO_PROVIDER, isManagedRepoProvider, REPO_PROVIDER_VALUES } from './chunk-
|
|
5
|
-
import { parseArgs, flagString, flagBool } from './chunk-
|
|
6
|
-
import { ApiClient } from './chunk-
|
|
7
|
-
import { readAuth, readProjectLink } from './chunk-
|
|
8
|
-
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-
|
|
2
|
+
import { promptYesNo } from './chunk-I4HNHPEM.mjs';
|
|
3
|
+
import { gitRemoteHead, managedProviderForHost } from './chunk-EDZSOL5O.mjs';
|
|
4
|
+
import { TOKEN_PURPOSE, REPO_PROVIDER, isManagedRepoProvider, REPO_PROVIDER_VALUES } from './chunk-LLRUOIMU.mjs';
|
|
5
|
+
import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
|
|
6
|
+
import { ApiClient } from './chunk-CLQYPTJ2.mjs';
|
|
7
|
+
import { readAuth, readProjectLink } from './chunk-TT4YI33G.mjs';
|
|
8
|
+
import { CliError, CLI_ERROR_CODE, isJsonMode, result, dim, success, info, bold } from './chunk-KOD4GBQ5.mjs';
|
|
9
9
|
|
|
10
10
|
// src/commands/repo.ts
|
|
11
11
|
var SUB_PROVISION = "provision";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { sha256 } from './chunk-25ZPFHLF.mjs';
|
|
3
|
+
import { resolveBaseUrl, ApiClient } from './chunk-CLQYPTJ2.mjs';
|
|
4
|
+
import { readAuthOrNull } from './chunk-TT4YI33G.mjs';
|
|
5
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-KOD4GBQ5.mjs';
|
|
6
|
+
import { existsSync, readFileSync } from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
9
|
+
var CONTENT_REMOTE_ENV = "CIMPLIFY_CONTENT_REMOTE";
|
|
10
|
+
var CONTENT_FAKE_ROOT_ENV = "CIMPLIFY_CONTENT_FAKE_ROOT";
|
|
11
|
+
var FAKE_REMOTE = "fake";
|
|
12
|
+
var RESOLVE_PATH = "/v1/content/resolve";
|
|
13
|
+
var BLOB_PATH = "/v1/content/blobs/";
|
|
14
|
+
var RESOLUTION_FILE = "resolution.json";
|
|
15
|
+
var BLOB_DIR = "blobs";
|
|
16
|
+
var HttpContentRemote = class {
|
|
17
|
+
client;
|
|
18
|
+
baseUrl;
|
|
19
|
+
constructor(client, baseUrl) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
this.baseUrl = baseUrl;
|
|
22
|
+
}
|
|
23
|
+
async resolve(items) {
|
|
24
|
+
const resolution = await this.client.post(RESOLVE_PATH, { items });
|
|
25
|
+
return resolution.versions;
|
|
26
|
+
}
|
|
27
|
+
async blob(digest) {
|
|
28
|
+
const url = new URL(`${BLOB_PATH}${digest}`, this.baseUrl).toString();
|
|
29
|
+
const response = await fetch(url);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new CliError(CLI_ERROR_CODE.NOT_FOUND, `Workshop has no blob ${digest} (HTTP ${response.status})`);
|
|
32
|
+
}
|
|
33
|
+
const bytes = Buffer.from(await response.arrayBuffer());
|
|
34
|
+
if (sha256(bytes) !== digest) {
|
|
35
|
+
throw new CliError(CLI_ERROR_CODE.NETWORK_ERROR, `the Workshop blob ${digest} did not match its digest`);
|
|
36
|
+
}
|
|
37
|
+
return bytes;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var DirectoryContentRemote = class {
|
|
41
|
+
root;
|
|
42
|
+
constructor(root) {
|
|
43
|
+
this.root = root;
|
|
44
|
+
}
|
|
45
|
+
async resolve(items) {
|
|
46
|
+
const file = path.join(this.root, RESOLUTION_FILE);
|
|
47
|
+
if (!existsSync(file)) throw new CliError(CLI_ERROR_CODE.NOT_FOUND, `the local Workshop at ${this.root} has no ${RESOLUTION_FILE}`);
|
|
48
|
+
const all = JSON.parse(readFileSync(file, "utf8"));
|
|
49
|
+
const wanted = new Set(items.map((i) => i.item));
|
|
50
|
+
const chosen = /* @__PURE__ */ new Map();
|
|
51
|
+
const queue = all.filter((v) => wanted.has(v.item));
|
|
52
|
+
for (const item of wanted) {
|
|
53
|
+
if (!queue.some((v) => v.item === item)) throw new CliError(CLI_ERROR_CODE.NOT_FOUND, `the local Workshop has no ${item}`);
|
|
54
|
+
}
|
|
55
|
+
while (queue.length > 0) {
|
|
56
|
+
const next = queue.shift();
|
|
57
|
+
if (chosen.has(next.item)) continue;
|
|
58
|
+
chosen.set(next.item, { ...next, requested: wanted.has(next.item) });
|
|
59
|
+
const manifest = JSON.parse((await this.blob(next.version_digest)).toString("utf8"));
|
|
60
|
+
for (const dependency of manifest.dependencies ?? []) {
|
|
61
|
+
const found = all.find((v) => v.version_digest === dependency.version_digest);
|
|
62
|
+
if (found !== void 0) queue.push(found);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return [...chosen.values()];
|
|
66
|
+
}
|
|
67
|
+
async blob(digest) {
|
|
68
|
+
const file = path.join(this.root, BLOB_DIR, digest);
|
|
69
|
+
if (!existsSync(file)) throw new CliError(CLI_ERROR_CODE.NOT_FOUND, `the local Workshop has no blob ${digest}`);
|
|
70
|
+
return readFileSync(file);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
async function contentRemoteFromEnv() {
|
|
74
|
+
if (process.env[CONTENT_REMOTE_ENV] === FAKE_REMOTE) {
|
|
75
|
+
const root = process.env[CONTENT_FAKE_ROOT_ENV];
|
|
76
|
+
if (root === void 0 || root.length === 0) {
|
|
77
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${CONTENT_REMOTE_ENV}=${FAKE_REMOTE} needs ${CONTENT_FAKE_ROOT_ENV} to name a local Workshop directory`);
|
|
78
|
+
}
|
|
79
|
+
return new DirectoryContentRemote(root);
|
|
80
|
+
}
|
|
81
|
+
const auth = await readAuthOrNull();
|
|
82
|
+
const baseUrl = auth?.apiBaseUrl ?? resolveBaseUrl();
|
|
83
|
+
return new HttpContentRemote(auth === null ? ApiClient.unauthenticated(baseUrl) : ApiClient.fromAuth(auth), baseUrl);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { contentRemoteFromEnv };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseManifest, MANIFEST_FILE } from './chunk-T4MW3PD4.mjs';
|
|
3
|
+
import { formatDiagnostic } from './chunk-SGT5IJVW.mjs';
|
|
4
|
+
import { CliError, CLI_ERROR_CODE } from './chunk-KOD4GBQ5.mjs';
|
|
5
|
+
import { promises } from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
|
|
8
|
+
// src/interactives/remote/port.ts
|
|
9
|
+
var CHANNELS = ["live", "test"];
|
|
10
|
+
var RemoteError = class extends Error {
|
|
11
|
+
code;
|
|
12
|
+
constructor(code, message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = "RemoteError";
|
|
15
|
+
this.code = code;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
async function readInteractiveId(root) {
|
|
19
|
+
const parsed = parseManifest(await promises.readFile(path.join(root, MANIFEST_FILE), "utf8"));
|
|
20
|
+
if (parsed.manifest === null) {
|
|
21
|
+
throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${MANIFEST_FILE} is invalid:
|
|
22
|
+
${parsed.diagnostics.map(formatDiagnostic).join("\n")}`);
|
|
23
|
+
}
|
|
24
|
+
if (parsed.manifest.identity.id === null) {
|
|
25
|
+
throw new CliError(CLI_ERROR_CODE.NOT_LINKED, "this Interactive has not been published yet", {
|
|
26
|
+
remediation: "Run `cimplify publish --channel test` to publish it."
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return parsed.manifest.identity.id;
|
|
30
|
+
}
|
|
31
|
+
async function remoteCall(call) {
|
|
32
|
+
try {
|
|
33
|
+
return await call();
|
|
34
|
+
} catch (err) {
|
|
35
|
+
if (!(err instanceof RemoteError)) throw err;
|
|
36
|
+
const code = err.code === "not_found" ? CLI_ERROR_CODE.NOT_FOUND : err.code === "unauthorized" ? CLI_ERROR_CODE.UNAUTHORIZED : CLI_ERROR_CODE.INVALID_INPUT;
|
|
37
|
+
throw new CliError(code, err.message);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { CHANNELS, RemoteError, readInteractiveId, remoteCall };
|