@kelceyp/caw-server 1.0.69 → 1.0.71

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/cli.js CHANGED
@@ -9892,8 +9892,86 @@ var create62 = ({ httpClient }) => {
9892
9892
  };
9893
9893
  var get_default4 = Object.freeze({ create: create62 });
9894
9894
 
9895
- // src/commands/export/list.js
9895
+ // src/commands/job/create.js
9896
9896
  var create63 = ({ httpClient }) => {
9897
+ return createCommand("create").summary("Create and run a job").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("agent").type("string").flag("agent").required()).param((p) => p.name("prompt").type("string").flag("prompt").required()).param((p) => p.name("name").type("string").flag("name")).param((p) => p.name("model").type("string").flag("model")).param((p) => p.name("workingDirectory").type("string").flag("working-directory")).param((p) => p.name("objectId").type("string").flag("object-id")).param((p) => p.name("streaming").type("boolean").flag("streaming")).param((p) => p.name("blocking").type("boolean").flag("blocking")).run(async (ctx) => {
9898
+ const { sid, agent, prompt, name, model, workingDirectory, objectId, streaming, blocking } = ctx.params;
9899
+ const args = { agent, prompt };
9900
+ if (name !== undefined)
9901
+ args.name = name;
9902
+ if (model !== undefined)
9903
+ args.model = model;
9904
+ if (workingDirectory !== undefined)
9905
+ args.workingDirectory = workingDirectory;
9906
+ if (objectId !== undefined)
9907
+ args.objectId = objectId;
9908
+ if (streaming !== undefined)
9909
+ args.streaming = streaming;
9910
+ if (blocking !== undefined)
9911
+ args.blocking = blocking;
9912
+ const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
9913
+ cwd: process.cwd(),
9914
+ tool: "create_job",
9915
+ args
9916
+ });
9917
+ ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
9918
+ `);
9919
+ }).onError({ exitCode: 1 }).build();
9920
+ };
9921
+ var create_default5 = Object.freeze({ create: create63 });
9922
+
9923
+ // src/commands/job/continue.js
9924
+ var create64 = ({ httpClient }) => {
9925
+ return createCommand("continue").summary("Continue a job with a follow-up prompt").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).param((p) => p.name("prompt").type("string").flag("prompt").required()).param((p) => p.name("model").type("string").flag("model")).param((p) => p.name("blocking").type("boolean").flag("blocking")).run(async (ctx) => {
9926
+ const { sid, id, prompt, model, blocking } = ctx.params;
9927
+ const args = { id, prompt };
9928
+ if (model !== undefined)
9929
+ args.model = model;
9930
+ if (blocking !== undefined)
9931
+ args.blocking = blocking;
9932
+ const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
9933
+ cwd: process.cwd(),
9934
+ tool: "continue_job",
9935
+ args
9936
+ });
9937
+ ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
9938
+ `);
9939
+ }).onError({ exitCode: 1 }).build();
9940
+ };
9941
+ var continue_default = Object.freeze({ create: create64 });
9942
+
9943
+ // src/commands/job/output.js
9944
+ var create65 = ({ httpClient }) => {
9945
+ return createCommand("output").summary("Read job output content").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).run(async (ctx) => {
9946
+ const { sid, id } = ctx.params;
9947
+ const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
9948
+ cwd: process.cwd(),
9949
+ tool: "read_job_output",
9950
+ args: { id }
9951
+ });
9952
+ ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
9953
+ `);
9954
+ }).onError({ exitCode: 1 }).build();
9955
+ };
9956
+ var output_default = Object.freeze({ create: create65 });
9957
+
9958
+ // src/commands/job/prompt.js
9959
+ var create66 = ({ httpClient }) => {
9960
+ return createCommand("prompt").summary("Read job prompt content").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).run(async (ctx) => {
9961
+ const { sid, id } = ctx.params;
9962
+ const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
9963
+ cwd: process.cwd(),
9964
+ tool: "read_job_prompt",
9965
+ args: { id }
9966
+ });
9967
+ ctx.stdio.stdout.write(JSON.stringify(result, null, 2) + `
9968
+ `);
9969
+ }).onError({ exitCode: 1 }).build();
9970
+ };
9971
+ var prompt_default = Object.freeze({ create: create66 });
9972
+
9973
+ // src/commands/export/list.js
9974
+ var create67 = ({ httpClient }) => {
9897
9975
  return createCommand("list").summary("List available export files").param((p) => p.name("sid").type("string").flag("sid", "s").required()).run(async (ctx) => {
9898
9976
  const { sid } = ctx.params;
9899
9977
  const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
@@ -9905,10 +9983,10 @@ var create63 = ({ httpClient }) => {
9905
9983
  `);
9906
9984
  }).onError({ exitCode: 1 }).build();
9907
9985
  };
9908
- var list_default4 = Object.freeze({ create: create63 });
9986
+ var list_default4 = Object.freeze({ create: create67 });
9909
9987
 
9910
9988
  // src/commands/export/preview.js
9911
- var create64 = ({ httpClient }) => {
9989
+ var create68 = ({ httpClient }) => {
9912
9990
  return createCommand("preview").summary("Preview export").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("store").type("string").flag("store")).run(async (ctx) => {
9913
9991
  const { sid, store } = ctx.params;
9914
9992
  const args = {};
@@ -9923,10 +10001,10 @@ var create64 = ({ httpClient }) => {
9923
10001
  `);
9924
10002
  }).onError({ exitCode: 1 }).build();
9925
10003
  };
9926
- var preview_default = Object.freeze({ create: create64 });
10004
+ var preview_default = Object.freeze({ create: create68 });
9927
10005
 
9928
10006
  // src/commands/export/export.js
9929
- var create65 = ({ httpClient }) => {
10007
+ var create69 = ({ httpClient }) => {
9930
10008
  return createCommand("export").summary("Export documents and templates").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("confirm").type("boolean").flag("confirm")).param((p) => p.name("store").type("string").flag("store")).run(async (ctx) => {
9931
10009
  const { sid, confirm, store } = ctx.params;
9932
10010
  const args = {};
@@ -9943,10 +10021,10 @@ var create65 = ({ httpClient }) => {
9943
10021
  `);
9944
10022
  }).onError({ exitCode: 1 }).build();
9945
10023
  };
9946
- var export_default = Object.freeze({ create: create65 });
10024
+ var export_default = Object.freeze({ create: create69 });
9947
10025
 
9948
10026
  // src/commands/export/import.js
9949
- var create66 = ({ httpClient }) => {
10027
+ var create70 = ({ httpClient }) => {
9950
10028
  return createCommand("import").summary("Import documents and templates").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) => {
9951
10029
  const { sid, filename, store } = ctx.params;
9952
10030
  const args = { filename };
@@ -9961,10 +10039,10 @@ var create66 = ({ httpClient }) => {
9961
10039
  `);
9962
10040
  }).onError({ exitCode: 1 }).build();
9963
10041
  };
9964
- var import_default = Object.freeze({ create: create66 });
10042
+ var import_default = Object.freeze({ create: create70 });
9965
10043
 
9966
10044
  // src/commands/asset/read.js
9967
- var create67 = ({ httpClient }) => {
10045
+ var create71 = ({ httpClient }) => {
9968
10046
  return createCommand("read").summary("Read an asset").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("id").type("string").flag("id").required()).run(async (ctx) => {
9969
10047
  const { sid, id } = ctx.params;
9970
10048
  const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
@@ -9976,13 +10054,13 @@ var create67 = ({ httpClient }) => {
9976
10054
  `);
9977
10055
  }).onError({ exitCode: 1 }).build();
9978
10056
  };
9979
- var read_default2 = Object.freeze({ create: create67 });
10057
+ var read_default2 = Object.freeze({ create: create71 });
9980
10058
 
9981
10059
  // src/cli-main.js
9982
10060
  var CAW_URL = process.env.CAW_URL || "https://caw.localhost";
9983
10061
  try {
9984
10062
  const httpClient = http_client_default.create({ baseUrl: CAW_URL });
9985
- 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(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(delete_default4.create({ httpClient })).command(inc_jobs_default.create({ httpClient })).command(dec_jobs_default.create({ httpClient })).build()).group(createCommandGroup("template").summary("Template operations").command(create_default4.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_default3.create({ httpClient })).command(get_default4.create({ httpClient })).build()).group(createCommandGroup("export").summary("Export operations").command(list_default4.create({ httpClient })).command(preview_default.create({ httpClient })).command(export_default.create({ httpClient })).command(import_default.create({ httpClient })).build()).group(createCommandGroup("asset").summary("Asset operations").command(read_default2.create({ httpClient })).build());
10063
+ 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(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(delete_default4.create({ httpClient })).command(inc_jobs_default.create({ httpClient })).command(dec_jobs_default.create({ httpClient })).build()).group(createCommandGroup("template").summary("Template operations").command(create_default4.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_default3.create({ httpClient })).command(get_default4.create({ httpClient })).command(create_default5.create({ httpClient })).command(continue_default.create({ httpClient })).command(output_default.create({ httpClient })).command(prompt_default.create({ httpClient })).build()).group(createCommandGroup("export").summary("Export operations").command(list_default4.create({ httpClient })).command(preview_default.create({ httpClient })).command(export_default.create({ httpClient })).command(import_default.create({ httpClient })).build()).group(createCommandGroup("asset").summary("Asset operations").command(read_default2.create({ httpClient })).build());
9986
10064
  await app.run(process.argv.slice(2));
9987
10065
  } catch (error) {
9988
10066
  console.error(`Error: ${error.message}`);