@kelceyp/caw-server 0.0.46 → 0.0.47

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
@@ -8726,7 +8726,12 @@ var read_default = Object.freeze({ create: create5 });
8726
8726
 
8727
8727
  // src/commands/doc/create.js
8728
8728
  var create6 = ({ httpClient }) => {
8729
- return createCommand("create").summary("Create a document").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("path").type("string").flag("path")).param((p) => p.name("store").type("string").flag("store")).param((p) => p.name("root").type("string").flag("root")).param((p) => p.name("parent").type("string").flag("parent")).param((p) => p.name("name").type("string").flag("name")).param((p) => p.name("content").type("string").flag("content")).run(async (ctx) => {
8729
+ return createCommand("create").summary("Create a document").param((p) => p.name("sid").type("string").flag("sid", "s").required()).param((p) => p.name("path").type("string").flag("path")).param((p) => p.name("store").type("string").flag("store")).param((p) => p.name("root").type("string").flag("root")).param((p) => p.name("parent").type("string").flag("parent")).param((p) => p.name("name").type("string").flag("name")).param((p) => p.name("content").type("string").flag("content").stdin()).preValidate((ctx) => {
8730
+ if (ctx.stdin.available && ctx.argv.flags.content) {
8731
+ return "Cannot use --content when piping stdin";
8732
+ }
8733
+ return true;
8734
+ }).run(async (ctx) => {
8730
8735
  const { sid, path, store, root, parent, name, content } = ctx.params;
8731
8736
  const args = {};
8732
8737
  if (path !== undefined)
@@ -8754,7 +8759,15 @@ var create_default = Object.freeze({ create: create6 });
8754
8759
 
8755
8760
  // src/commands/doc/save.js
8756
8761
  var create7 = ({ httpClient }) => {
8757
- return createCommand("save").summary("Save document draft").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("content").type("string").flag("content").required()).run(async (ctx) => {
8762
+ return createCommand("save").summary("Save document draft").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("content").type("string").flag("content").stdin()).preValidate((ctx) => {
8763
+ if (ctx.stdin.available && ctx.argv.flags.content) {
8764
+ return "Cannot use --content when piping stdin";
8765
+ }
8766
+ if (!ctx.stdin.available && !ctx.argv.flags.content) {
8767
+ return "Content required via --content or stdin";
8768
+ }
8769
+ return true;
8770
+ }).run(async (ctx) => {
8758
8771
  const { sid, id, content } = ctx.params;
8759
8772
  const result = await httpClient.post(`/cli/mcp-client/${sid}/dispatch`, {
8760
8773
  cwd: process.cwd(),