@kelceyp/caw-server 1.0.244 → 1.0.246
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 +1 -1
- package/dist/cli.js +78 -35
- package/dist/main.js +572 -646
- package/dist/public_html/main.js +639 -639
- package/dist/public_html/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ server/
|
|
|
62
62
|
│ │ ├── DocumentRoutes.js
|
|
63
63
|
│ │ ├── TemplateRoutes.js
|
|
64
64
|
│ │ ├── FieldRoutes.js
|
|
65
|
-
│ │ ├──
|
|
65
|
+
│ │ ├── BundleRoutes.js
|
|
66
66
|
│ │ └── EventRoutes.js
|
|
67
67
|
│ ├── core/ # Business logic layer
|
|
68
68
|
│ │ ├── Core.js # Facade - token resolution, service caching
|
package/dist/cli.js
CHANGED
|
@@ -10127,106 +10127,149 @@ var create72 = ({ httpClient }) => {
|
|
|
10127
10127
|
};
|
|
10128
10128
|
var prompt_default = Object.freeze({ create: create72 });
|
|
10129
10129
|
|
|
10130
|
-
// src/commands/job/resume.js
|
|
10130
|
+
// src/commands/job/cancel-resume.js
|
|
10131
10131
|
var create73 = ({ httpClient }) => {
|
|
10132
|
-
return createCommand("resume").summary("
|
|
10132
|
+
return createCommand("cancel-resume").summary("Cancel the scheduled resume for an awaiting-resume job").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).run(async (ctx) => {
|
|
10133
10133
|
const { sid, id } = ctx.params;
|
|
10134
10134
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10135
10135
|
cwd: process.cwd(),
|
|
10136
|
-
tool: "
|
|
10136
|
+
tool: "cancel_job_resume",
|
|
10137
10137
|
args: { jobId: id }
|
|
10138
10138
|
});
|
|
10139
10139
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10140
10140
|
`);
|
|
10141
10141
|
}).onError({ exitCode: 1 }).build();
|
|
10142
10142
|
};
|
|
10143
|
-
var
|
|
10143
|
+
var cancel_resume_default = Object.freeze({ create: create73 });
|
|
10144
10144
|
|
|
10145
|
-
// src/commands/
|
|
10145
|
+
// src/commands/bundle/list.js
|
|
10146
10146
|
var create74 = ({ httpClient }) => {
|
|
10147
|
-
return createCommand("
|
|
10148
|
-
const { sid,
|
|
10147
|
+
return createCommand("list").summary("List available bundles").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("store").type("string").flag("store")).run(async (ctx) => {
|
|
10148
|
+
const { sid, store } = ctx.params;
|
|
10149
|
+
const args = {};
|
|
10150
|
+
if (store !== undefined)
|
|
10151
|
+
args.store = store;
|
|
10149
10152
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10150
10153
|
cwd: process.cwd(),
|
|
10151
|
-
tool: "
|
|
10152
|
-
args
|
|
10154
|
+
tool: "list_bundles",
|
|
10155
|
+
args
|
|
10153
10156
|
});
|
|
10154
10157
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10155
10158
|
`);
|
|
10156
10159
|
}).onError({ exitCode: 1 }).build();
|
|
10157
10160
|
};
|
|
10158
|
-
var
|
|
10161
|
+
var list_default5 = Object.freeze({ create: create74 });
|
|
10159
10162
|
|
|
10160
|
-
// src/commands/
|
|
10163
|
+
// src/commands/bundle/preview.js
|
|
10164
|
+
var splitIds = (value) => value.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
10161
10165
|
var create75 = ({ httpClient }) => {
|
|
10162
|
-
return createCommand("
|
|
10163
|
-
const {
|
|
10166
|
+
return createCommand("preview").summary("Preview a bundle export (dependency walk)").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("store").type("string").flag("store")).param((p) => p.name("pickedDocIds").type("string").flag("pickedDocIds")).param((p) => p.name("pickedTemplateIds").type("string").flag("pickedTemplateIds")).param((p) => p.name("pickedTrackIds").type("string").flag("pickedTrackIds")).param((p) => p.name("pickedFolderIds").type("string").flag("pickedFolderIds")).param((p) => p.name("excludeIds").type("string").flag("excludeIds")).run(async (ctx) => {
|
|
10167
|
+
const {
|
|
10168
|
+
sid,
|
|
10169
|
+
store,
|
|
10170
|
+
pickedDocIds,
|
|
10171
|
+
pickedTemplateIds,
|
|
10172
|
+
pickedTrackIds,
|
|
10173
|
+
pickedFolderIds,
|
|
10174
|
+
excludeIds
|
|
10175
|
+
} = ctx.params;
|
|
10176
|
+
const args = { commit: false };
|
|
10177
|
+
if (pickedDocIds !== undefined)
|
|
10178
|
+
args.pickedDocIds = splitIds(pickedDocIds);
|
|
10179
|
+
if (pickedTemplateIds !== undefined)
|
|
10180
|
+
args.pickedTemplateIds = splitIds(pickedTemplateIds);
|
|
10181
|
+
if (pickedTrackIds !== undefined)
|
|
10182
|
+
args.pickedTrackIds = splitIds(pickedTrackIds);
|
|
10183
|
+
if (pickedFolderIds !== undefined)
|
|
10184
|
+
args.pickedFolderIds = splitIds(pickedFolderIds);
|
|
10185
|
+
if (excludeIds !== undefined)
|
|
10186
|
+
args.excludeIds = splitIds(excludeIds);
|
|
10187
|
+
if (store !== undefined)
|
|
10188
|
+
args.store = store;
|
|
10164
10189
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10165
10190
|
cwd: process.cwd(),
|
|
10166
|
-
tool: "
|
|
10167
|
-
args
|
|
10191
|
+
tool: "export_bundle",
|
|
10192
|
+
args
|
|
10168
10193
|
});
|
|
10169
10194
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10170
10195
|
`);
|
|
10171
10196
|
}).onError({ exitCode: 1 }).build();
|
|
10172
10197
|
};
|
|
10173
|
-
var
|
|
10198
|
+
var preview_default = Object.freeze({ create: create75 });
|
|
10174
10199
|
|
|
10175
|
-
// src/commands/export
|
|
10200
|
+
// src/commands/bundle/export.js
|
|
10201
|
+
var splitIds2 = (value) => value.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
10176
10202
|
var create76 = ({ httpClient }) => {
|
|
10177
|
-
return createCommand("
|
|
10178
|
-
const {
|
|
10179
|
-
|
|
10203
|
+
return createCommand("export").summary("Export a bundle (commit)").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("name").type("string").flag("name").required()).param((p) => p.name("store").type("string").flag("store")).param((p) => p.name("pickedDocIds").type("string").flag("pickedDocIds")).param((p) => p.name("pickedTemplateIds").type("string").flag("pickedTemplateIds")).param((p) => p.name("pickedTrackIds").type("string").flag("pickedTrackIds")).param((p) => p.name("pickedFolderIds").type("string").flag("pickedFolderIds")).param((p) => p.name("excludeIds").type("string").flag("excludeIds")).run(async (ctx) => {
|
|
10204
|
+
const {
|
|
10205
|
+
sid,
|
|
10206
|
+
name,
|
|
10207
|
+
store,
|
|
10208
|
+
pickedDocIds,
|
|
10209
|
+
pickedTemplateIds,
|
|
10210
|
+
pickedTrackIds,
|
|
10211
|
+
pickedFolderIds,
|
|
10212
|
+
excludeIds
|
|
10213
|
+
} = ctx.params;
|
|
10214
|
+
const args = { commit: true, name };
|
|
10215
|
+
if (pickedDocIds !== undefined)
|
|
10216
|
+
args.pickedDocIds = splitIds2(pickedDocIds);
|
|
10217
|
+
if (pickedTemplateIds !== undefined)
|
|
10218
|
+
args.pickedTemplateIds = splitIds2(pickedTemplateIds);
|
|
10219
|
+
if (pickedTrackIds !== undefined)
|
|
10220
|
+
args.pickedTrackIds = splitIds2(pickedTrackIds);
|
|
10221
|
+
if (pickedFolderIds !== undefined)
|
|
10222
|
+
args.pickedFolderIds = splitIds2(pickedFolderIds);
|
|
10223
|
+
if (excludeIds !== undefined)
|
|
10224
|
+
args.excludeIds = splitIds2(excludeIds);
|
|
10180
10225
|
if (store !== undefined)
|
|
10181
10226
|
args.store = store;
|
|
10182
10227
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10183
10228
|
cwd: process.cwd(),
|
|
10184
|
-
tool: "
|
|
10229
|
+
tool: "export_bundle",
|
|
10185
10230
|
args
|
|
10186
10231
|
});
|
|
10187
10232
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10188
10233
|
`);
|
|
10189
10234
|
}).onError({ exitCode: 1 }).build();
|
|
10190
10235
|
};
|
|
10191
|
-
var
|
|
10236
|
+
var export_default = Object.freeze({ create: create76 });
|
|
10192
10237
|
|
|
10193
|
-
// src/commands/
|
|
10238
|
+
// src/commands/bundle/import.js
|
|
10194
10239
|
var create77 = ({ httpClient }) => {
|
|
10195
|
-
return createCommand("
|
|
10196
|
-
const { sid,
|
|
10197
|
-
const args = {};
|
|
10198
|
-
if (confirm !== undefined)
|
|
10199
|
-
args.confirm = confirm;
|
|
10240
|
+
return createCommand("import").summary("Import a bundle (non-destructive)").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("filename").type("string").flag("filename").required()).param((p) => p.name("store").type("string").flag("store")).run(async (ctx) => {
|
|
10241
|
+
const { sid, filename, store } = ctx.params;
|
|
10242
|
+
const args = { filename };
|
|
10200
10243
|
if (store !== undefined)
|
|
10201
10244
|
args.store = store;
|
|
10202
10245
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10203
10246
|
cwd: process.cwd(),
|
|
10204
|
-
tool: "
|
|
10247
|
+
tool: "import_bundle",
|
|
10205
10248
|
args
|
|
10206
10249
|
});
|
|
10207
10250
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10208
10251
|
`);
|
|
10209
10252
|
}).onError({ exitCode: 1 }).build();
|
|
10210
10253
|
};
|
|
10211
|
-
var
|
|
10254
|
+
var import_default = Object.freeze({ create: create77 });
|
|
10212
10255
|
|
|
10213
|
-
// src/commands/
|
|
10256
|
+
// src/commands/bundle/delete.js
|
|
10214
10257
|
var create78 = ({ httpClient }) => {
|
|
10215
|
-
return createCommand("
|
|
10258
|
+
return createCommand("delete").summary("Delete a bundle").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("filename").type("string").flag("filename").required()).param((p) => p.name("store").type("string").flag("store")).run(async (ctx) => {
|
|
10216
10259
|
const { sid, filename, store } = ctx.params;
|
|
10217
10260
|
const args = { filename };
|
|
10218
10261
|
if (store !== undefined)
|
|
10219
10262
|
args.store = store;
|
|
10220
10263
|
const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
|
|
10221
10264
|
cwd: process.cwd(),
|
|
10222
|
-
tool: "
|
|
10265
|
+
tool: "delete_bundle",
|
|
10223
10266
|
args
|
|
10224
10267
|
});
|
|
10225
10268
|
ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
|
|
10226
10269
|
`);
|
|
10227
10270
|
}).onError({ exitCode: 1 }).build();
|
|
10228
10271
|
};
|
|
10229
|
-
var
|
|
10272
|
+
var delete_default6 = Object.freeze({ create: create78 });
|
|
10230
10273
|
|
|
10231
10274
|
// src/commands/asset/read.js
|
|
10232
10275
|
var create79 = ({ httpClient }) => {
|
|
@@ -10286,7 +10329,7 @@ var reindex_default = Object.freeze({ create: create81 });
|
|
|
10286
10329
|
var CAW_URL = process.env.CAW_URL || "http://localhost:2229";
|
|
10287
10330
|
try {
|
|
10288
10331
|
const httpClient = http_client_default.create({ baseUrl: CAW_URL });
|
|
10289
|
-
const app = create().name("caw").version("0.0.1").command(connect_default.create({ httpClient })).command(disconnect_default.create({ httpClient })).group(createCommandGroup("doc").summary("Document operations").command(read_default.create({ httpClient })).command(create_default.create({ httpClient })).command(save_default.create({ httpClient })).command(publish_default.create({ httpClient })).command(read_by_path_default.create({ httpClient })).command(update_path_default.create({ httpClient })).command(versions_default.create({ httpClient })).command(read_version_default.create({ httpClient })).command(discard_default.create({ httpClient })).command(delete_default.create({ httpClient })).command(read_lines_default.create({ httpClient })).command(read_head_default.create({ httpClient })).command(read_tail_default.create({ httpClient })).command(read_from_line_default.create({ httpClient })).command(read_to_line_default.create({ httpClient })).command(read_between_markers_default.create({ httpClient })).command(read_section_default.create({ httpClient })).command(headings_default.create({ httpClient })).command(checklist_default.create({ httpClient })).command(stats_default.create({ httpClient })).command(frontmatter_default.create({ httpClient })).command(edit_default.create({ httpClient })).command(batch_edit_default.create({ httpClient })).command(check_item_default.create({ httpClient })).command(toggle_item_default.create({ httpClient })).command(batch_check_items_default.create({ httpClient })).command(set_edit_state_default.create({ httpClient })).command(clear_edit_state_default.create({ httpClient })).command(get_edit_state_default.create({ httpClient })).command(check_includes_default.create({ httpClient })).command(update_includes_default.create({ httpClient })).build()).group(createCommandGroup("folder").summary("Folder operations").command(list_default.create({ httpClient })).command(create_default2.create({ httpClient })).command(get_default.create({ httpClient })).command(get_by_path_default.create({ httpClient })).command(rename_default.create({ httpClient })).command(move_default.create({ httpClient })).command(delete_default2.create({ httpClient })).build()).group(createCommandGroup("field").summary("Field operations").command(get_default2.create({ httpClient })).command(get_field_default.create({ httpClient })).command(set_default.create({ httpClient })).command(delete_default3.create({ httpClient })).command(create_def_default.create({ httpClient })).command(list_defs_default.create({ httpClient })).command(get_type_fields_default.create({ httpClient })).command(delete_def_default.create({ httpClient })).build()).group(createCommandGroup("story").summary("Story operations").command(create_default3.create({ httpClient })).command(list_default2.create({ httpClient })).command(get_default3.create({ httpClient })).command(update_state_default.create({ httpClient })).command(change_track_default.create({ httpClient })).command(delete_default4.create({ httpClient })).command(inc_jobs_default.create({ httpClient })).command(dec_jobs_default.create({ httpClient })).build()).group(createCommandGroup("track").summary("Track operations").command(list_default3.create({ httpClient })).command(create_default4.create({ httpClient })).command(update_default.create({ httpClient })).command(delete_default5.create({ httpClient })).build()).group(createCommandGroup("template").summary("Template operations").command(create_default5.create({ httpClient })).command(render_default.create({ httpClient })).command(params_default.create({ httpClient })).command(list_by_type_default.create({ httpClient })).build()).group(createCommandGroup("job").summary("Job operations").command(list_default4.create({ httpClient })).command(get_default4.create({ httpClient })).command(create_default6.create({ httpClient })).command(continue_default.create({ httpClient })).command(output_default.create({ httpClient })).command(prompt_default.create({ httpClient })).command(
|
|
10332
|
+
const app = create().name("caw").version("0.0.1").command(connect_default.create({ httpClient })).command(disconnect_default.create({ httpClient })).group(createCommandGroup("doc").summary("Document operations").command(read_default.create({ httpClient })).command(create_default.create({ httpClient })).command(save_default.create({ httpClient })).command(publish_default.create({ httpClient })).command(read_by_path_default.create({ httpClient })).command(update_path_default.create({ httpClient })).command(versions_default.create({ httpClient })).command(read_version_default.create({ httpClient })).command(discard_default.create({ httpClient })).command(delete_default.create({ httpClient })).command(read_lines_default.create({ httpClient })).command(read_head_default.create({ httpClient })).command(read_tail_default.create({ httpClient })).command(read_from_line_default.create({ httpClient })).command(read_to_line_default.create({ httpClient })).command(read_between_markers_default.create({ httpClient })).command(read_section_default.create({ httpClient })).command(headings_default.create({ httpClient })).command(checklist_default.create({ httpClient })).command(stats_default.create({ httpClient })).command(frontmatter_default.create({ httpClient })).command(edit_default.create({ httpClient })).command(batch_edit_default.create({ httpClient })).command(check_item_default.create({ httpClient })).command(toggle_item_default.create({ httpClient })).command(batch_check_items_default.create({ httpClient })).command(set_edit_state_default.create({ httpClient })).command(clear_edit_state_default.create({ httpClient })).command(get_edit_state_default.create({ httpClient })).command(check_includes_default.create({ httpClient })).command(update_includes_default.create({ httpClient })).build()).group(createCommandGroup("folder").summary("Folder operations").command(list_default.create({ httpClient })).command(create_default2.create({ httpClient })).command(get_default.create({ httpClient })).command(get_by_path_default.create({ httpClient })).command(rename_default.create({ httpClient })).command(move_default.create({ httpClient })).command(delete_default2.create({ httpClient })).build()).group(createCommandGroup("field").summary("Field operations").command(get_default2.create({ httpClient })).command(get_field_default.create({ httpClient })).command(set_default.create({ httpClient })).command(delete_default3.create({ httpClient })).command(create_def_default.create({ httpClient })).command(list_defs_default.create({ httpClient })).command(get_type_fields_default.create({ httpClient })).command(delete_def_default.create({ httpClient })).build()).group(createCommandGroup("story").summary("Story operations").command(create_default3.create({ httpClient })).command(list_default2.create({ httpClient })).command(get_default3.create({ httpClient })).command(update_state_default.create({ httpClient })).command(change_track_default.create({ httpClient })).command(delete_default4.create({ httpClient })).command(inc_jobs_default.create({ httpClient })).command(dec_jobs_default.create({ httpClient })).build()).group(createCommandGroup("track").summary("Track operations").command(list_default3.create({ httpClient })).command(create_default4.create({ httpClient })).command(update_default.create({ httpClient })).command(delete_default5.create({ httpClient })).build()).group(createCommandGroup("template").summary("Template operations").command(create_default5.create({ httpClient })).command(render_default.create({ httpClient })).command(params_default.create({ httpClient })).command(list_by_type_default.create({ httpClient })).build()).group(createCommandGroup("job").summary("Job operations").command(list_default4.create({ httpClient })).command(get_default4.create({ httpClient })).command(create_default6.create({ httpClient })).command(continue_default.create({ httpClient })).command(output_default.create({ httpClient })).command(prompt_default.create({ httpClient })).command(cancel_resume_default.create({ httpClient })).build()).group(createCommandGroup("bundle").summary("Bundle operations").command(list_default5.create({ httpClient })).command(preview_default.create({ httpClient })).command(export_default.create({ httpClient })).command(import_default.create({ httpClient })).command(delete_default6.create({ httpClient })).build()).group(createCommandGroup("asset").summary("Asset operations").command(read_default2.create({ httpClient })).build()).group(createCommandGroup("backfill").summary("Backfill operations").command(content_refs_default.create({ httpClient })).build()).group(createCommandGroup("embeddings").summary("Embedding operations").command(reindex_default.create({ httpClient })).build());
|
|
10290
10333
|
await app.run(process.argv.slice(2));
|
|
10291
10334
|
} catch (error) {
|
|
10292
10335
|
console.error(`Error: ${error.message}`);
|