@wayai/cli 0.3.72 → 0.3.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +186 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7859,6 +7859,7 @@ var workspace_exports = {};
|
|
|
7859
7859
|
__export(workspace_exports, {
|
|
7860
7860
|
autoRenameHubFolder: () => autoRenameHubFolder,
|
|
7861
7861
|
detectWorkspace: () => detectWorkspace,
|
|
7862
|
+
filterPreviewHubs: () => filterPreviewHubs,
|
|
7862
7863
|
findEnclosingHubFolder: () => findEnclosingHubFolder,
|
|
7863
7864
|
findGitRoot: () => findGitRoot,
|
|
7864
7865
|
findHubByFolderName: () => findHubByFolderName,
|
|
@@ -7866,10 +7867,12 @@ __export(workspace_exports, {
|
|
|
7866
7867
|
findRepoRootSync: () => findRepoRootSync,
|
|
7867
7868
|
getChangedHubs: () => getChangedHubs,
|
|
7868
7869
|
getHubFolderSlug: () => getHubFolderSlug,
|
|
7870
|
+
isPreviewHub: () => isPreviewHub,
|
|
7869
7871
|
resolveActiveHubId: () => resolveActiveHubId,
|
|
7870
7872
|
resolveExplicitHubPath: () => resolveExplicitHubPath,
|
|
7871
7873
|
resolveHubFolder: () => resolveHubFolder,
|
|
7872
7874
|
resolveHubFolderBySelector: () => resolveHubFolderBySelector,
|
|
7875
|
+
resolveWorkspaceDir: () => resolveWorkspaceDir,
|
|
7873
7876
|
scanNewHubs: () => scanNewHubs,
|
|
7874
7877
|
scanWorkspaceHubs: () => scanWorkspaceHubs
|
|
7875
7878
|
});
|
|
@@ -7905,6 +7908,16 @@ function detectWorkspace() {
|
|
|
7905
7908
|
}
|
|
7906
7909
|
return { gitRoot, workspaceDir: hubsDir };
|
|
7907
7910
|
}
|
|
7911
|
+
function resolveWorkspaceDir() {
|
|
7912
|
+
const workspace = detectWorkspace();
|
|
7913
|
+
if (workspace) return workspace.workspaceDir;
|
|
7914
|
+
const gitRoot = findGitRoot();
|
|
7915
|
+
if (!gitRoot) {
|
|
7916
|
+
console.error("Not inside a git repository.");
|
|
7917
|
+
process.exit(1);
|
|
7918
|
+
}
|
|
7919
|
+
return resolveLayout(gitRoot).hubsDir;
|
|
7920
|
+
}
|
|
7908
7921
|
function readHubYaml(yamlPath) {
|
|
7909
7922
|
if (!fs2.existsSync(yamlPath)) return null;
|
|
7910
7923
|
try {
|
|
@@ -7928,6 +7941,12 @@ function scanWorkspaceHubs(workspaceDir) {
|
|
|
7928
7941
|
}
|
|
7929
7942
|
return hubs;
|
|
7930
7943
|
}
|
|
7944
|
+
function isPreviewHub(hub) {
|
|
7945
|
+
return hub.hubEnvironment === "preview";
|
|
7946
|
+
}
|
|
7947
|
+
function filterPreviewHubs(hubs) {
|
|
7948
|
+
return hubs.filter(isPreviewHub);
|
|
7949
|
+
}
|
|
7931
7950
|
function readNewHubYaml(yamlPath) {
|
|
7932
7951
|
if (!fs2.existsSync(yamlPath)) return null;
|
|
7933
7952
|
try {
|
|
@@ -8020,7 +8039,7 @@ function getChangedHubs(workspaceDir) {
|
|
|
8020
8039
|
hubs.push({ hubFolder, hubId: meta.hubId, hubEnvironment: meta.hubEnvironment });
|
|
8021
8040
|
}
|
|
8022
8041
|
}
|
|
8023
|
-
return hubs;
|
|
8042
|
+
return filterPreviewHubs(hubs);
|
|
8024
8043
|
}
|
|
8025
8044
|
function resolveExplicitHubPath(hubPath) {
|
|
8026
8045
|
const parts = hubPath.split("/");
|
|
@@ -8128,13 +8147,14 @@ function resolveActiveHubId(args2) {
|
|
|
8128
8147
|
}
|
|
8129
8148
|
const enclosing = findEnclosingHubFolder(workspaceDir);
|
|
8130
8149
|
if (enclosing) return enclosing.hubId;
|
|
8131
|
-
|
|
8132
|
-
if (
|
|
8150
|
+
const previewHubs = filterPreviewHubs(allHubs);
|
|
8151
|
+
if (previewHubs.length === 1) return previewHubs[0].hubId;
|
|
8152
|
+
if (previewHubs.length === 0) {
|
|
8133
8153
|
console.error(`No hub folders found in ${wsLabel}/. Run \`wayai pull --hub <uuid>\` to fetch a hub for the first time, or pass --hub <uuid>.`);
|
|
8134
8154
|
process.exit(1);
|
|
8135
8155
|
}
|
|
8136
8156
|
console.error(`Multiple hubs in ${wsLabel}/. Pass --hub <uuid|folder-name> or run from inside a hub folder:`);
|
|
8137
|
-
for (const h of
|
|
8157
|
+
for (const h of previewHubs) {
|
|
8138
8158
|
console.error(` ${path2.basename(h.hubFolder)} (${h.hubId})`);
|
|
8139
8159
|
}
|
|
8140
8160
|
process.exit(1);
|
|
@@ -10709,7 +10729,9 @@ var pull_exports = {};
|
|
|
10709
10729
|
__export(pull_exports, {
|
|
10710
10730
|
connectionsEqual: () => connectionsEqual,
|
|
10711
10731
|
downloadBinaryResourceFiles: () => downloadBinaryResourceFiles,
|
|
10712
|
-
pullCommand: () => pullCommand
|
|
10732
|
+
pullCommand: () => pullCommand,
|
|
10733
|
+
resolveHubTarget: () => resolveHubTarget,
|
|
10734
|
+
writeProductionMirror: () => writeProductionMirror
|
|
10713
10735
|
});
|
|
10714
10736
|
import * as fs11 from "fs";
|
|
10715
10737
|
import * as path13 from "path";
|
|
@@ -10740,13 +10762,14 @@ function resolveHubTarget(workspaceDir, selector) {
|
|
|
10740
10762
|
}
|
|
10741
10763
|
const enclosing = findEnclosingHubFolder(workspaceDir);
|
|
10742
10764
|
if (enclosing) return { hubId: enclosing.hubId, hubFolder: enclosing.hubFolder };
|
|
10743
|
-
|
|
10744
|
-
if (
|
|
10765
|
+
const previewHubs = filterPreviewHubs(allHubs);
|
|
10766
|
+
if (previewHubs.length === 1) return { hubId: previewHubs[0].hubId, hubFolder: previewHubs[0].hubFolder };
|
|
10767
|
+
if (previewHubs.length === 0) {
|
|
10745
10768
|
console.error(`No hub folders found in ${wsLabel}/. Pass --hub <uuid> to fetch a hub for the first time.`);
|
|
10746
10769
|
process.exit(1);
|
|
10747
10770
|
}
|
|
10748
10771
|
console.error(`Multiple hubs found in ${wsLabel}/. Pass --hub <uuid|folder-name> to choose, or run from inside a hub folder:`);
|
|
10749
|
-
for (const h of
|
|
10772
|
+
for (const h of previewHubs) {
|
|
10750
10773
|
console.error(` ${path13.basename(h.hubFolder)} (${h.hubId})`);
|
|
10751
10774
|
}
|
|
10752
10775
|
process.exit(1);
|
|
@@ -10757,27 +10780,18 @@ async function pullCommand(args2) {
|
|
|
10757
10780
|
const { organization_id: organizationId } = repoConfig;
|
|
10758
10781
|
const { config, accessToken } = await requireAuth();
|
|
10759
10782
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
10760
|
-
|
|
10761
|
-
const workspace = detectWorkspace();
|
|
10783
|
+
const workspaceDir = resolveWorkspaceDir();
|
|
10762
10784
|
const gitRoot = findGitRoot();
|
|
10763
|
-
if (workspace) {
|
|
10764
|
-
workspaceDir = workspace.workspaceDir;
|
|
10765
|
-
} else {
|
|
10766
|
-
if (!gitRoot) {
|
|
10767
|
-
console.error("Not inside a git repository.");
|
|
10768
|
-
process.exit(1);
|
|
10769
|
-
}
|
|
10770
|
-
workspaceDir = resolveLayout(gitRoot).hubsDir;
|
|
10771
|
-
}
|
|
10772
10785
|
if (gitRoot) warnLayoutOnce(gitRoot);
|
|
10773
10786
|
const { hubId, hubFolder: existingFolder } = resolveHubTarget(workspaceDir, hubSelector);
|
|
10774
|
-
assertHubMatchesBinding(hubId);
|
|
10775
10787
|
console.log("Fetching hub configuration...");
|
|
10776
10788
|
const payload = await client.pull(hubId, organizationId);
|
|
10777
10789
|
if (payload.hub_environment === "production") {
|
|
10778
|
-
|
|
10790
|
+
const folder = await writeProductionMirror(workspaceDir, payload);
|
|
10791
|
+
console.log(`Production hub mirrored (read-only) \u2192 ${folder}`);
|
|
10779
10792
|
return;
|
|
10780
10793
|
}
|
|
10794
|
+
assertHubMatchesBinding(hubId);
|
|
10781
10795
|
let hubFolder = existingFolder;
|
|
10782
10796
|
let wroteFiles = false;
|
|
10783
10797
|
if (!hubFolder) {
|
|
@@ -10844,6 +10858,38 @@ async function pullCommand(args2) {
|
|
|
10844
10858
|
if (cancelled) return;
|
|
10845
10859
|
}
|
|
10846
10860
|
if (wroteFiles) autoBindIfUnbound(hubId);
|
|
10861
|
+
if (payload.production_hub_id) {
|
|
10862
|
+
await mirrorLinkedProduction(client, workspaceDir, payload.production_hub_id, organizationId);
|
|
10863
|
+
}
|
|
10864
|
+
}
|
|
10865
|
+
async function writeProductionMirror(workspaceDir, prodPayload) {
|
|
10866
|
+
const folder = resolveHubFolder(workspaceDir, prodPayload.hub_id, prodPayload.hub.name, "production", null, null);
|
|
10867
|
+
fs11.mkdirSync(path13.dirname(folder), { recursive: true });
|
|
10868
|
+
writeHubFolder(folder, prodPayload);
|
|
10869
|
+
await downloadBinaryResourceFiles(folder, prodPayload);
|
|
10870
|
+
const finalFolder = autoRenameHubFolder(folder, prodPayload.hub.name, "production", prodPayload.hub_id, null, null);
|
|
10871
|
+
prependMirrorMarker(finalFolder, prodPayload.hub_id);
|
|
10872
|
+
return finalFolder;
|
|
10873
|
+
}
|
|
10874
|
+
async function mirrorLinkedProduction(client, workspaceDir, productionHubId, organizationId) {
|
|
10875
|
+
try {
|
|
10876
|
+
const prodPayload = await client.pull(productionHubId, organizationId);
|
|
10877
|
+
const folder = await writeProductionMirror(workspaceDir, prodPayload);
|
|
10878
|
+
console.log(`Mirrored production hub \u2192 ${folder} (read-only)`);
|
|
10879
|
+
} catch (err) {
|
|
10880
|
+
console.warn(`Warning: could not mirror production hub (${err instanceof Error ? err.message : String(err)}). Preview pull is unaffected.`);
|
|
10881
|
+
}
|
|
10882
|
+
}
|
|
10883
|
+
function prependMirrorMarker(hubFolder, productionHubId) {
|
|
10884
|
+
const hubYaml = path13.join(hubFolder, "hub.yaml");
|
|
10885
|
+
try {
|
|
10886
|
+
const content = fs11.readFileSync(hubYaml, "utf-8");
|
|
10887
|
+
if (content.startsWith(MIRROR_MARKER_PREFIX)) return;
|
|
10888
|
+
const marker = `${MIRROR_MARKER_PREFIX} ${productionHubId}. Edits are ignored; push is blocked. Edit the linked preview hub instead.
|
|
10889
|
+
`;
|
|
10890
|
+
fs11.writeFileSync(hubYaml, marker + content, "utf-8");
|
|
10891
|
+
} catch {
|
|
10892
|
+
}
|
|
10847
10893
|
}
|
|
10848
10894
|
async function downloadBinaryResourceFiles(hubFolder, payload) {
|
|
10849
10895
|
const resources = payload.resources || [];
|
|
@@ -10870,6 +10916,7 @@ function connectionsEqual(a, b) {
|
|
|
10870
10916
|
}
|
|
10871
10917
|
return true;
|
|
10872
10918
|
}
|
|
10919
|
+
var MIRROR_MARKER_PREFIX;
|
|
10873
10920
|
var init_pull = __esm({
|
|
10874
10921
|
"src/commands/pull.ts"() {
|
|
10875
10922
|
"use strict";
|
|
@@ -10884,6 +10931,7 @@ var init_pull = __esm({
|
|
|
10884
10931
|
init_layout();
|
|
10885
10932
|
init_repo_config();
|
|
10886
10933
|
init_hub_binding();
|
|
10934
|
+
MIRROR_MARKER_PREFIX = "# Read-only mirror of production hub";
|
|
10887
10935
|
}
|
|
10888
10936
|
});
|
|
10889
10937
|
|
|
@@ -11149,16 +11197,6 @@ async function pushSingleHub(client, hubId, hubFolder, autoConfirm, organization
|
|
|
11149
11197
|
autoBindIfUnbound(hubId);
|
|
11150
11198
|
return true;
|
|
11151
11199
|
}
|
|
11152
|
-
function resolveWorkspaceDir() {
|
|
11153
|
-
const workspace = detectWorkspace();
|
|
11154
|
-
if (workspace) return workspace.workspaceDir;
|
|
11155
|
-
const gitRoot = findGitRoot();
|
|
11156
|
-
if (!gitRoot) {
|
|
11157
|
-
console.error("Not inside a git repository.");
|
|
11158
|
-
process.exit(1);
|
|
11159
|
-
}
|
|
11160
|
-
return resolveLayout(gitRoot).hubsDir;
|
|
11161
|
-
}
|
|
11162
11200
|
function selectExistingHub(workspaceDir, allHubs, selector, wsLabel) {
|
|
11163
11201
|
if (selector) {
|
|
11164
11202
|
const match = allHubs.find(
|
|
@@ -11172,7 +11210,8 @@ function selectExistingHub(workspaceDir, allHubs, selector, wsLabel) {
|
|
|
11172
11210
|
}
|
|
11173
11211
|
const enclosing = findEnclosingHubFolder(workspaceDir);
|
|
11174
11212
|
if (enclosing) return enclosing;
|
|
11175
|
-
|
|
11213
|
+
const previewHubs = filterPreviewHubs(allHubs);
|
|
11214
|
+
if (previewHubs.length === 1) return previewHubs[0];
|
|
11176
11215
|
return null;
|
|
11177
11216
|
}
|
|
11178
11217
|
function selectNewHub(newHubs, selector) {
|
|
@@ -11205,6 +11244,10 @@ async function pushCommand(args2) {
|
|
|
11205
11244
|
const newHubs = scanNewHubs(workspaceDir);
|
|
11206
11245
|
const existing = selectExistingHub(workspaceDir, existingHubs, hubSelector, wsLabel);
|
|
11207
11246
|
if (existing) {
|
|
11247
|
+
if (existing.hubEnvironment === "production") {
|
|
11248
|
+
console.log("This is a read-only production mirror \u2014 production hubs cannot be pushed. Edit the linked preview hub instead.");
|
|
11249
|
+
return;
|
|
11250
|
+
}
|
|
11208
11251
|
assertHubMatchesBinding(existing.hubId, path14.basename(existing.hubFolder));
|
|
11209
11252
|
await pushSingleHub(client, existing.hubId, existing.hubFolder, autoConfirm, organizationId);
|
|
11210
11253
|
return;
|
|
@@ -11286,6 +11329,85 @@ var init_push = __esm({
|
|
|
11286
11329
|
}
|
|
11287
11330
|
});
|
|
11288
11331
|
|
|
11332
|
+
// src/commands/diff.ts
|
|
11333
|
+
var diff_exports = {};
|
|
11334
|
+
__export(diff_exports, {
|
|
11335
|
+
diffCommand: () => diffCommand,
|
|
11336
|
+
parseArgs: () => parseArgs6
|
|
11337
|
+
});
|
|
11338
|
+
function parseArgs6(args2) {
|
|
11339
|
+
let production = false;
|
|
11340
|
+
let hubSelector;
|
|
11341
|
+
for (let i = 0; i < args2.length; i++) {
|
|
11342
|
+
const arg = args2[i];
|
|
11343
|
+
if (arg === "--production") {
|
|
11344
|
+
production = true;
|
|
11345
|
+
} else if (arg === "--hub" && args2[i + 1]) {
|
|
11346
|
+
hubSelector = args2[++i];
|
|
11347
|
+
}
|
|
11348
|
+
}
|
|
11349
|
+
return { production, hubSelector };
|
|
11350
|
+
}
|
|
11351
|
+
async function diffCommand(args2) {
|
|
11352
|
+
const { production, hubSelector } = parseArgs6(args2);
|
|
11353
|
+
const repoConfig = requireRepoConfig();
|
|
11354
|
+
const { organization_id: organizationId } = repoConfig;
|
|
11355
|
+
const { config, accessToken } = await requireAuth();
|
|
11356
|
+
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
11357
|
+
const workspaceDir = resolveWorkspaceDir();
|
|
11358
|
+
const gitRoot = findGitRoot();
|
|
11359
|
+
if (gitRoot) warnLayoutOnce(gitRoot);
|
|
11360
|
+
const { hubId: previewHubId, hubFolder } = resolveHubTarget(workspaceDir, hubSelector);
|
|
11361
|
+
if (!hubFolder) {
|
|
11362
|
+
console.error("Hub is not materialized locally \u2014 nothing to diff. Run `wayai pull` first.");
|
|
11363
|
+
process.exit(1);
|
|
11364
|
+
}
|
|
11365
|
+
console.log("Parsing local configuration...");
|
|
11366
|
+
const localConfig = parseHubFolder(hubFolder);
|
|
11367
|
+
let targetHubId = previewHubId;
|
|
11368
|
+
let label = "preview";
|
|
11369
|
+
if (production) {
|
|
11370
|
+
if (localConfig.hub_environment === "production") {
|
|
11371
|
+
console.log("This is a read-only production mirror \u2014 run `wayai diff --production` from the preview workspace instead.");
|
|
11372
|
+
return;
|
|
11373
|
+
}
|
|
11374
|
+
const { hubs } = await client.listHubs(organizationId);
|
|
11375
|
+
const entry = hubs.find((h) => h.hub_id === previewHubId);
|
|
11376
|
+
const productionHubId = entry?.production_hub_id ?? null;
|
|
11377
|
+
if (!productionHubId) {
|
|
11378
|
+
console.log("This preview has no linked production hub yet (never published) \u2014 nothing to diff against production.");
|
|
11379
|
+
return;
|
|
11380
|
+
}
|
|
11381
|
+
targetHubId = productionHubId;
|
|
11382
|
+
label = "production";
|
|
11383
|
+
}
|
|
11384
|
+
console.log(`Computing diff against ${label}...`);
|
|
11385
|
+
const result = await client.diff(targetHubId, localConfig, "push", organizationId);
|
|
11386
|
+
printWarnings(result.warnings);
|
|
11387
|
+
if (!result.has_changes) {
|
|
11388
|
+
console.log(`
|
|
11389
|
+
No differences \u2014 local files match ${label}.`);
|
|
11390
|
+
return;
|
|
11391
|
+
}
|
|
11392
|
+
console.log(`
|
|
11393
|
+
Local files vs ${label.toUpperCase()}:`);
|
|
11394
|
+
printDiff(result.summary);
|
|
11395
|
+
}
|
|
11396
|
+
var init_diff = __esm({
|
|
11397
|
+
"src/commands/diff.ts"() {
|
|
11398
|
+
"use strict";
|
|
11399
|
+
init_auth();
|
|
11400
|
+
init_api_client();
|
|
11401
|
+
init_parser();
|
|
11402
|
+
init_diff_display();
|
|
11403
|
+
init_push();
|
|
11404
|
+
init_pull();
|
|
11405
|
+
init_repo_config();
|
|
11406
|
+
init_layout();
|
|
11407
|
+
init_workspace();
|
|
11408
|
+
}
|
|
11409
|
+
});
|
|
11410
|
+
|
|
11289
11411
|
// src/commands/use.ts
|
|
11290
11412
|
var use_exports = {};
|
|
11291
11413
|
__export(use_exports, {
|
|
@@ -12026,10 +12148,10 @@ var init_delete_history = __esm({
|
|
|
12026
12148
|
// src/commands/sync-skills.ts
|
|
12027
12149
|
var sync_skills_exports = {};
|
|
12028
12150
|
__export(sync_skills_exports, {
|
|
12029
|
-
parseArgs: () =>
|
|
12151
|
+
parseArgs: () => parseArgs7,
|
|
12030
12152
|
syncSkillsCommand: () => syncSkillsCommand
|
|
12031
12153
|
});
|
|
12032
|
-
function
|
|
12154
|
+
function parseArgs7(args2) {
|
|
12033
12155
|
let connectionId;
|
|
12034
12156
|
const idx = args2.indexOf("--connection-id");
|
|
12035
12157
|
if (idx !== -1 && args2[idx + 1]) {
|
|
@@ -12052,7 +12174,7 @@ function printSyncResults(response) {
|
|
|
12052
12174
|
}
|
|
12053
12175
|
async function syncSkillsCommand(args2) {
|
|
12054
12176
|
const hubId = resolveActiveHubId(args2);
|
|
12055
|
-
const { connectionId } =
|
|
12177
|
+
const { connectionId } = parseArgs7(args2);
|
|
12056
12178
|
requireRepoConfig();
|
|
12057
12179
|
const { config, accessToken } = await requireAuth();
|
|
12058
12180
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
@@ -12077,10 +12199,10 @@ var init_sync_skills = __esm({
|
|
|
12077
12199
|
// src/commands/sync-mcp.ts
|
|
12078
12200
|
var sync_mcp_exports = {};
|
|
12079
12201
|
__export(sync_mcp_exports, {
|
|
12080
|
-
parseArgs: () =>
|
|
12202
|
+
parseArgs: () => parseArgs8,
|
|
12081
12203
|
syncMcpCommand: () => syncMcpCommand
|
|
12082
12204
|
});
|
|
12083
|
-
function
|
|
12205
|
+
function parseArgs8(args2) {
|
|
12084
12206
|
let connection;
|
|
12085
12207
|
for (let i = 0; i < args2.length; i++) {
|
|
12086
12208
|
const arg = args2[i];
|
|
@@ -12092,7 +12214,7 @@ function parseArgs7(args2) {
|
|
|
12092
12214
|
}
|
|
12093
12215
|
async function syncMcpCommand(args2) {
|
|
12094
12216
|
const hubId = resolveActiveHubId(args2);
|
|
12095
|
-
const { connection } =
|
|
12217
|
+
const { connection } = parseArgs8(args2);
|
|
12096
12218
|
if (!connection) {
|
|
12097
12219
|
console.error("Usage: wayai sync-mcp --connection <name> [--hub <uuid|folder-name>]");
|
|
12098
12220
|
console.error("");
|
|
@@ -12708,7 +12830,7 @@ function isValidSetName(name) {
|
|
|
12708
12830
|
if (name.startsWith(".")) return false;
|
|
12709
12831
|
return !/[\/\\\0]/.test(name);
|
|
12710
12832
|
}
|
|
12711
|
-
function
|
|
12833
|
+
function parseArgs9(args2) {
|
|
12712
12834
|
if (args2.length === 0 || args2[0].startsWith("-")) {
|
|
12713
12835
|
console.error("Usage: wayai eval capture <conversation_id> [--set <name>] [--name <eval_name>] [--instructions <text>]");
|
|
12714
12836
|
process.exit(1);
|
|
@@ -12754,7 +12876,7 @@ function parseArgs8(args2) {
|
|
|
12754
12876
|
}
|
|
12755
12877
|
async function evalCaptureCommand(args2) {
|
|
12756
12878
|
const hubId = resolveActiveHubId(args2);
|
|
12757
|
-
const parsed =
|
|
12879
|
+
const parsed = parseArgs9(args2);
|
|
12758
12880
|
const { config, accessToken } = await requireAuth();
|
|
12759
12881
|
requireRepoConfig();
|
|
12760
12882
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
@@ -12831,7 +12953,7 @@ var journey_capture_exports = {};
|
|
|
12831
12953
|
__export(journey_capture_exports, {
|
|
12832
12954
|
journeyCaptureCommand: () => journeyCaptureCommand
|
|
12833
12955
|
});
|
|
12834
|
-
function
|
|
12956
|
+
function parseArgs10(args2) {
|
|
12835
12957
|
if (args2.length === 0 || args2[0].startsWith("-")) {
|
|
12836
12958
|
console.error("Usage: wayai eval journey capture <conversation_id> [--name <journey_name>] [--instructions <text>]");
|
|
12837
12959
|
process.exit(1);
|
|
@@ -12866,7 +12988,7 @@ function parseArgs9(args2) {
|
|
|
12866
12988
|
}
|
|
12867
12989
|
async function journeyCaptureCommand(args2) {
|
|
12868
12990
|
const hubId = resolveActiveHubId(args2);
|
|
12869
|
-
const parsed =
|
|
12991
|
+
const parsed = parseArgs10(args2);
|
|
12870
12992
|
const { config, accessToken } = await requireAuth();
|
|
12871
12993
|
requireRepoConfig();
|
|
12872
12994
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
@@ -16520,9 +16642,9 @@ var init_credential_utils = __esm({
|
|
|
16520
16642
|
var create_credential_exports = {};
|
|
16521
16643
|
__export(create_credential_exports, {
|
|
16522
16644
|
createCredentialCommand: () => createCredentialCommand,
|
|
16523
|
-
parseArgs: () =>
|
|
16645
|
+
parseArgs: () => parseArgs11
|
|
16524
16646
|
});
|
|
16525
|
-
function
|
|
16647
|
+
function parseArgs11(args2) {
|
|
16526
16648
|
let name;
|
|
16527
16649
|
let type;
|
|
16528
16650
|
let orgId;
|
|
@@ -16550,7 +16672,7 @@ function parseArgs10(args2) {
|
|
|
16550
16672
|
return { name, type, orgId, description, tags: splitTagRefs(tags), environment, stdin };
|
|
16551
16673
|
}
|
|
16552
16674
|
async function createCredentialCommand(args2) {
|
|
16553
|
-
const parsed =
|
|
16675
|
+
const parsed = parseArgs11(args2);
|
|
16554
16676
|
if (!parsed.name) {
|
|
16555
16677
|
console.error("Missing required flag: --name <credential-name>");
|
|
16556
16678
|
console.error('Usage: wayai create-credential --name "openai-key" --type "Bearer Token"');
|
|
@@ -16657,10 +16779,10 @@ var init_create_credential = __esm({
|
|
|
16657
16779
|
// src/commands/update-credential.ts
|
|
16658
16780
|
var update_credential_exports = {};
|
|
16659
16781
|
__export(update_credential_exports, {
|
|
16660
|
-
parseArgs: () =>
|
|
16782
|
+
parseArgs: () => parseArgs12,
|
|
16661
16783
|
updateCredentialCommand: () => updateCredentialCommand
|
|
16662
16784
|
});
|
|
16663
|
-
function
|
|
16785
|
+
function parseArgs12(args2) {
|
|
16664
16786
|
let name;
|
|
16665
16787
|
let rename;
|
|
16666
16788
|
let orgId;
|
|
@@ -16693,7 +16815,7 @@ function parseArgs11(args2) {
|
|
|
16693
16815
|
return { name, rename, orgId, description, tags: splitTagRefs(tags), hasTagFlag, environment, stdin, secretPrompt };
|
|
16694
16816
|
}
|
|
16695
16817
|
async function updateCredentialCommand(args2) {
|
|
16696
|
-
const parsed =
|
|
16818
|
+
const parsed = parseArgs12(args2);
|
|
16697
16819
|
if (!parsed.name) {
|
|
16698
16820
|
console.error("Missing required flag: --name <credential-name>");
|
|
16699
16821
|
console.error('Usage: wayai update-credential --name "my-key" --stdin');
|
|
@@ -17052,9 +17174,9 @@ var init_org = __esm({
|
|
|
17052
17174
|
var list_exports = {};
|
|
17053
17175
|
__export(list_exports, {
|
|
17054
17176
|
listCommand: () => listCommand,
|
|
17055
|
-
parseArgs: () =>
|
|
17177
|
+
parseArgs: () => parseArgs13
|
|
17056
17178
|
});
|
|
17057
|
-
function
|
|
17179
|
+
function parseArgs13(args2) {
|
|
17058
17180
|
let orgId;
|
|
17059
17181
|
let json = false;
|
|
17060
17182
|
for (let i = 0; i < args2.length; i++) {
|
|
@@ -17067,7 +17189,7 @@ function parseArgs12(args2) {
|
|
|
17067
17189
|
return { orgId, json };
|
|
17068
17190
|
}
|
|
17069
17191
|
async function listCommand(args2) {
|
|
17070
|
-
const { orgId, json } =
|
|
17192
|
+
const { orgId, json } = parseArgs13(args2);
|
|
17071
17193
|
const { config, accessToken } = await requireAuth();
|
|
17072
17194
|
const client = new ApiClient({ apiUrl: config.api_url, accessToken });
|
|
17073
17195
|
const { organizations } = await client.organizations();
|
|
@@ -18629,12 +18751,12 @@ var init_admin = __esm({
|
|
|
18629
18751
|
});
|
|
18630
18752
|
|
|
18631
18753
|
// src/commands/report-create.ts
|
|
18632
|
-
import { readFileSync as
|
|
18754
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
18633
18755
|
import { dirname as dirname8, join as join24 } from "path";
|
|
18634
18756
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
18635
18757
|
function getCliVersion() {
|
|
18636
18758
|
try {
|
|
18637
|
-
const pkg2 = JSON.parse(
|
|
18759
|
+
const pkg2 = JSON.parse(readFileSync17(join24(__dirname, "..", "..", "package.json"), "utf-8"));
|
|
18638
18760
|
return `cli@${pkg2.version}`;
|
|
18639
18761
|
} catch {
|
|
18640
18762
|
return "cli@unknown";
|
|
@@ -19016,7 +19138,7 @@ var init_update = __esm({
|
|
|
19016
19138
|
|
|
19017
19139
|
// src/index.ts
|
|
19018
19140
|
init_sentry();
|
|
19019
|
-
import { readFileSync as
|
|
19141
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
19020
19142
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
19021
19143
|
import { dirname as dirname9, join as join25 } from "path";
|
|
19022
19144
|
|
|
@@ -19195,7 +19317,7 @@ Run \`wayai admin skill install\` to update.`);
|
|
|
19195
19317
|
|
|
19196
19318
|
// src/index.ts
|
|
19197
19319
|
var __dirname2 = dirname9(fileURLToPath3(import.meta.url));
|
|
19198
|
-
var pkg = JSON.parse(
|
|
19320
|
+
var pkg = JSON.parse(readFileSync18(join25(__dirname2, "..", "package.json"), "utf-8"));
|
|
19199
19321
|
var [, , command, ...args] = process.argv;
|
|
19200
19322
|
var isBackgroundRefresh = command === REFRESH_COMMAND;
|
|
19201
19323
|
if (!isBackgroundRefresh) initSentry(command);
|
|
@@ -19249,6 +19371,11 @@ async function main() {
|
|
|
19249
19371
|
await pushCommand2(args);
|
|
19250
19372
|
break;
|
|
19251
19373
|
}
|
|
19374
|
+
case "diff": {
|
|
19375
|
+
const { diffCommand: diffCommand2 } = await Promise.resolve().then(() => (init_diff(), diff_exports));
|
|
19376
|
+
await diffCommand2(args);
|
|
19377
|
+
break;
|
|
19378
|
+
}
|
|
19252
19379
|
case "use": {
|
|
19253
19380
|
const { useCommand: useCommand2 } = await Promise.resolve().then(() => (init_use(), use_exports));
|
|
19254
19381
|
await useCommand2(args);
|
|
@@ -19388,8 +19515,9 @@ Commands:
|
|
|
19388
19515
|
init Set up .wayai.yaml (pick organization)
|
|
19389
19516
|
create-credential Create an organization credential (API key, token, etc.)
|
|
19390
19517
|
update-credential Update / rotate an organization credential (by name)
|
|
19391
|
-
pull Fetch hub config and write local files
|
|
19518
|
+
pull Fetch hub config and write local files (also mirrors the linked production hub read-only)
|
|
19392
19519
|
push Parse local files, show diff, sync to preview (creates hub if new)
|
|
19520
|
+
diff Dry-run diff of local files vs the platform (--production diffs vs the linked production hub)
|
|
19393
19521
|
org create Create a new organization (you become its owner)
|
|
19394
19522
|
org <pull|push|diff> Sync org-scoped resources as code (wayai-ws/org/)
|
|
19395
19523
|
use <hub> Bind this worktree to a specific hub (UUID or folder name)
|
|
@@ -19415,7 +19543,8 @@ Commands:
|
|
|
19415
19543
|
|
|
19416
19544
|
Flags:
|
|
19417
19545
|
--yes, -y Skip confirmation prompts (useful for CI and scripting)
|
|
19418
|
-
--hub <uuid|name> Target hub when the workspace has more than one (push, pull)
|
|
19546
|
+
--hub <uuid|name> Target hub when the workspace has more than one (push, pull, diff)
|
|
19547
|
+
--production Diff local preview files against the linked production hub (diff)
|
|
19419
19548
|
--name <name> Credential name (create-credential; target for update-credential)
|
|
19420
19549
|
--type <auth-type> Auth type: "api_key", "bearer", "basic_auth" (create-credential)
|
|
19421
19550
|
--rename <name> New name for the credential (update-credential)
|