@wave-ai-os/wave-cli 0.1.85 → 0.1.86
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.cjs +49 -16
- package/dist/index.js +49 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8607,7 +8607,12 @@ function buildOperationManifest(program) {
|
|
|
8607
8607
|
}
|
|
8608
8608
|
|
|
8609
8609
|
// src/commands/osmd.ts
|
|
8610
|
-
var sourceSchema = import_zod18.z.enum([
|
|
8610
|
+
var sourceSchema = import_zod18.z.enum([
|
|
8611
|
+
"canonical_osmd",
|
|
8612
|
+
"agent_overlay",
|
|
8613
|
+
"agent_wiki",
|
|
8614
|
+
"thread_workspace"
|
|
8615
|
+
]);
|
|
8611
8616
|
var accessSchema = import_zod18.z.enum(["read_only", "read_write", "append_only"]).catch("read_write");
|
|
8612
8617
|
var ownerSchema = import_zod18.z.enum(["system", "atlas"]);
|
|
8613
8618
|
var suggestedActionSchema = import_zod18.z.enum([
|
|
@@ -8693,7 +8698,14 @@ var agentMarkdownFileSchema = import_zod18.z.preprocess(
|
|
|
8693
8698
|
suggestedAction: suggestedActionSchema,
|
|
8694
8699
|
errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
|
|
8695
8700
|
content: import_zod18.z.string().nullable().optional(),
|
|
8696
|
-
url: import_zod18.z.string().nullable().optional()
|
|
8701
|
+
url: import_zod18.z.string().nullable().optional(),
|
|
8702
|
+
workspaceId: import_zod18.z.string().nullable().optional(),
|
|
8703
|
+
fileId: import_zod18.z.string().nullable().optional(),
|
|
8704
|
+
name: import_zod18.z.string().nullable().optional(),
|
|
8705
|
+
displayName: import_zod18.z.string().nullable().optional(),
|
|
8706
|
+
contentSha: import_zod18.z.string().nullable().optional(),
|
|
8707
|
+
versionSha: import_zod18.z.string().nullable().optional(),
|
|
8708
|
+
mediaType: import_zod18.z.string().nullable().optional()
|
|
8697
8709
|
}).transform((value) => ({
|
|
8698
8710
|
...value,
|
|
8699
8711
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -8706,7 +8718,14 @@ var agentMarkdownFileSchema = import_zod18.z.preprocess(
|
|
|
8706
8718
|
parentRef: value.parentRef ?? null,
|
|
8707
8719
|
errorCode: value.errorCode ?? null,
|
|
8708
8720
|
content: value.content ?? null,
|
|
8709
|
-
url: value.url ?? null
|
|
8721
|
+
url: value.url ?? null,
|
|
8722
|
+
workspaceId: value.workspaceId ?? null,
|
|
8723
|
+
fileId: value.fileId ?? null,
|
|
8724
|
+
name: value.name ?? null,
|
|
8725
|
+
displayName: value.displayName ?? null,
|
|
8726
|
+
contentSha: value.contentSha ?? null,
|
|
8727
|
+
versionSha: value.versionSha ?? null,
|
|
8728
|
+
mediaType: value.mediaType ?? null
|
|
8710
8729
|
}))
|
|
8711
8730
|
);
|
|
8712
8731
|
var agentMarkdownFilesSchema = import_zod18.z.array(agentMarkdownFileSchema);
|
|
@@ -9011,6 +9030,13 @@ var AGENT_MARKDOWN_FILE_SELECTION = `{
|
|
|
9011
9030
|
errorCode
|
|
9012
9031
|
content
|
|
9013
9032
|
url
|
|
9033
|
+
workspaceId
|
|
9034
|
+
fileId
|
|
9035
|
+
name
|
|
9036
|
+
displayName
|
|
9037
|
+
contentSha
|
|
9038
|
+
versionSha
|
|
9039
|
+
mediaType
|
|
9014
9040
|
}`;
|
|
9015
9041
|
var OSMD_SEARCH_SELECTION = `{
|
|
9016
9042
|
query
|
|
@@ -9666,21 +9692,24 @@ async function runOsmdIngestFlow(params) {
|
|
|
9666
9692
|
})
|
|
9667
9693
|
});
|
|
9668
9694
|
}
|
|
9669
|
-
|
|
9695
|
+
var atlasThreadWorkspaceParentRefPattern = /^Atlas Workspace\/ATL-[A-Z0-9][A-Z0-9-]*$/;
|
|
9696
|
+
function normalizeAgentFilePath(file, parentRef) {
|
|
9670
9697
|
const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
|
|
9671
9698
|
const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
|
|
9672
|
-
|
|
9699
|
+
const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
|
|
9700
|
+
const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
|
|
9701
|
+
if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
|
|
9673
9702
|
throw new CliError({
|
|
9674
|
-
message: ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
|
|
9703
|
+
message: isThreadWorkspace ? "Atlas task workspaces support only lowercase kebab-case .md or .txt basenames." : ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
|
|
9675
9704
|
kind: "invalid_args",
|
|
9676
9705
|
status: 400,
|
|
9677
9706
|
exitCode: EXIT_CODES.invalidArgs,
|
|
9678
9707
|
details: {
|
|
9679
|
-
supportedFiles: [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9708
|
+
supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9680
9709
|
}
|
|
9681
9710
|
});
|
|
9682
9711
|
}
|
|
9683
|
-
return `.agent/${fileName}`;
|
|
9712
|
+
return isThreadWorkspace ? fileName : `.agent/${fileName}`;
|
|
9684
9713
|
}
|
|
9685
9714
|
function formatHumanList(items) {
|
|
9686
9715
|
if (items.length <= 1) {
|
|
@@ -10907,12 +10936,13 @@ function registerOsmdCommands(program) {
|
|
|
10907
10936
|
const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
|
|
10908
10937
|
agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10909
10938
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10939
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10910
10940
|
const result = await requestAgentMarkdownStatus({
|
|
10911
10941
|
command: "osmd.agent.status",
|
|
10912
10942
|
runtimeOptions,
|
|
10913
10943
|
organizationId,
|
|
10914
|
-
path: normalizeAgentFilePath(file),
|
|
10915
|
-
parentRef:
|
|
10944
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
10945
|
+
parentRef: normalizedParentRef
|
|
10916
10946
|
});
|
|
10917
10947
|
return printEnvelopeAndExit({
|
|
10918
10948
|
envelope: buildSuccessEnvelope({
|
|
@@ -10939,12 +10969,13 @@ function registerOsmdCommands(program) {
|
|
|
10939
10969
|
});
|
|
10940
10970
|
agent.command("read <parent-ref> <file>").description("Read a .agent file without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10941
10971
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10972
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10942
10973
|
const result = await requestAgentMarkdownFile({
|
|
10943
10974
|
command: "osmd.agent.read",
|
|
10944
10975
|
runtimeOptions,
|
|
10945
10976
|
organizationId,
|
|
10946
|
-
path: normalizeAgentFilePath(file),
|
|
10947
|
-
parentRef:
|
|
10977
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
10978
|
+
parentRef: normalizedParentRef
|
|
10948
10979
|
});
|
|
10949
10980
|
return printEnvelopeAndExit({
|
|
10950
10981
|
envelope: buildSuccessEnvelope({
|
|
@@ -10962,13 +10993,14 @@ function registerOsmdCommands(program) {
|
|
|
10962
10993
|
const globals = cmd.optsWithGlobals();
|
|
10963
10994
|
const content = await resolveContentInput(opts, globals);
|
|
10964
10995
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10996
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10965
10997
|
return runWriteFlow({
|
|
10966
10998
|
command: "osmd.agent.create",
|
|
10967
10999
|
action: "create",
|
|
10968
11000
|
runtimeOptions,
|
|
10969
11001
|
organizationId,
|
|
10970
|
-
path: normalizeAgentFilePath(file),
|
|
10971
|
-
parentRef:
|
|
11002
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11003
|
+
parentRef: normalizedParentRef,
|
|
10972
11004
|
content
|
|
10973
11005
|
});
|
|
10974
11006
|
}
|
|
@@ -10980,13 +11012,14 @@ function registerOsmdCommands(program) {
|
|
|
10980
11012
|
const globals = cmd.optsWithGlobals();
|
|
10981
11013
|
const content = await resolveContentInput(opts, globals);
|
|
10982
11014
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11015
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10983
11016
|
return runWriteFlow({
|
|
10984
11017
|
command: "osmd.agent.update",
|
|
10985
11018
|
action: "update",
|
|
10986
11019
|
runtimeOptions,
|
|
10987
11020
|
organizationId,
|
|
10988
|
-
path: normalizeAgentFilePath(file),
|
|
10989
|
-
parentRef:
|
|
11021
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11022
|
+
parentRef: normalizedParentRef,
|
|
10990
11023
|
content
|
|
10991
11024
|
});
|
|
10992
11025
|
}
|
package/dist/index.js
CHANGED
|
@@ -8606,7 +8606,12 @@ function buildOperationManifest(program) {
|
|
|
8606
8606
|
}
|
|
8607
8607
|
|
|
8608
8608
|
// src/commands/osmd.ts
|
|
8609
|
-
var sourceSchema = z18.enum([
|
|
8609
|
+
var sourceSchema = z18.enum([
|
|
8610
|
+
"canonical_osmd",
|
|
8611
|
+
"agent_overlay",
|
|
8612
|
+
"agent_wiki",
|
|
8613
|
+
"thread_workspace"
|
|
8614
|
+
]);
|
|
8610
8615
|
var accessSchema = z18.enum(["read_only", "read_write", "append_only"]).catch("read_write");
|
|
8611
8616
|
var ownerSchema = z18.enum(["system", "atlas"]);
|
|
8612
8617
|
var suggestedActionSchema = z18.enum([
|
|
@@ -8692,7 +8697,14 @@ var agentMarkdownFileSchema = z18.preprocess(
|
|
|
8692
8697
|
suggestedAction: suggestedActionSchema,
|
|
8693
8698
|
errorCode: agentMarkdownErrorCodeFieldSchema.optional(),
|
|
8694
8699
|
content: z18.string().nullable().optional(),
|
|
8695
|
-
url: z18.string().nullable().optional()
|
|
8700
|
+
url: z18.string().nullable().optional(),
|
|
8701
|
+
workspaceId: z18.string().nullable().optional(),
|
|
8702
|
+
fileId: z18.string().nullable().optional(),
|
|
8703
|
+
name: z18.string().nullable().optional(),
|
|
8704
|
+
displayName: z18.string().nullable().optional(),
|
|
8705
|
+
contentSha: z18.string().nullable().optional(),
|
|
8706
|
+
versionSha: z18.string().nullable().optional(),
|
|
8707
|
+
mediaType: z18.string().nullable().optional()
|
|
8696
8708
|
}).transform((value) => ({
|
|
8697
8709
|
...value,
|
|
8698
8710
|
wikiRole: value.wikiRole ?? null,
|
|
@@ -8705,7 +8717,14 @@ var agentMarkdownFileSchema = z18.preprocess(
|
|
|
8705
8717
|
parentRef: value.parentRef ?? null,
|
|
8706
8718
|
errorCode: value.errorCode ?? null,
|
|
8707
8719
|
content: value.content ?? null,
|
|
8708
|
-
url: value.url ?? null
|
|
8720
|
+
url: value.url ?? null,
|
|
8721
|
+
workspaceId: value.workspaceId ?? null,
|
|
8722
|
+
fileId: value.fileId ?? null,
|
|
8723
|
+
name: value.name ?? null,
|
|
8724
|
+
displayName: value.displayName ?? null,
|
|
8725
|
+
contentSha: value.contentSha ?? null,
|
|
8726
|
+
versionSha: value.versionSha ?? null,
|
|
8727
|
+
mediaType: value.mediaType ?? null
|
|
8709
8728
|
}))
|
|
8710
8729
|
);
|
|
8711
8730
|
var agentMarkdownFilesSchema = z18.array(agentMarkdownFileSchema);
|
|
@@ -9010,6 +9029,13 @@ var AGENT_MARKDOWN_FILE_SELECTION = `{
|
|
|
9010
9029
|
errorCode
|
|
9011
9030
|
content
|
|
9012
9031
|
url
|
|
9032
|
+
workspaceId
|
|
9033
|
+
fileId
|
|
9034
|
+
name
|
|
9035
|
+
displayName
|
|
9036
|
+
contentSha
|
|
9037
|
+
versionSha
|
|
9038
|
+
mediaType
|
|
9013
9039
|
}`;
|
|
9014
9040
|
var OSMD_SEARCH_SELECTION = `{
|
|
9015
9041
|
query
|
|
@@ -9665,21 +9691,24 @@ async function runOsmdIngestFlow(params) {
|
|
|
9665
9691
|
})
|
|
9666
9692
|
});
|
|
9667
9693
|
}
|
|
9668
|
-
|
|
9694
|
+
var atlasThreadWorkspaceParentRefPattern = /^Atlas Workspace\/ATL-[A-Z0-9][A-Z0-9-]*$/;
|
|
9695
|
+
function normalizeAgentFilePath(file, parentRef) {
|
|
9669
9696
|
const trimmed = nonEmptyString3.parse(file).trim().replace(/^\/+|\/+$/g, "");
|
|
9670
9697
|
const fileName = trimmed.startsWith(".agent/") ? trimmed.slice(".agent/".length) : trimmed;
|
|
9671
|
-
|
|
9698
|
+
const isThreadWorkspace = atlasThreadWorkspaceParentRefPattern.test(parentRef);
|
|
9699
|
+
const isSupportedFile = isThreadWorkspace ? /^[a-z0-9][a-z0-9-]*\.(?:md|txt)$/.test(fileName) : isSupportedAgentOverlayFileName(fileName);
|
|
9700
|
+
if (fileName.includes("\\") || fileName.includes("/") || fileName === "." || fileName === ".." || !isSupportedFile) {
|
|
9672
9701
|
throw new CliError({
|
|
9673
|
-
message: ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
|
|
9702
|
+
message: isThreadWorkspace ? "Atlas task workspaces support only lowercase kebab-case .md or .txt basenames." : ".agent supports only notes.md, summary.md, or <lowercase-kebab-slug>.md.",
|
|
9674
9703
|
kind: "invalid_args",
|
|
9675
9704
|
status: 400,
|
|
9676
9705
|
exitCode: EXIT_CODES.invalidArgs,
|
|
9677
9706
|
details: {
|
|
9678
|
-
supportedFiles: [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9707
|
+
supportedFiles: isThreadWorkspace ? ["<lowercase-kebab-slug>.md", "<lowercase-kebab-slug>.txt"] : [...supportedAgentOverlaySystemFiles, "<lowercase-kebab-slug>.md"]
|
|
9679
9708
|
}
|
|
9680
9709
|
});
|
|
9681
9710
|
}
|
|
9682
|
-
return `.agent/${fileName}`;
|
|
9711
|
+
return isThreadWorkspace ? fileName : `.agent/${fileName}`;
|
|
9683
9712
|
}
|
|
9684
9713
|
function formatHumanList(items) {
|
|
9685
9714
|
if (items.length <= 1) {
|
|
@@ -10906,12 +10935,13 @@ function registerOsmdCommands(program) {
|
|
|
10906
10935
|
const agent = osmd.command("agent").description(".agent markdown attached to canonical OSMD parents");
|
|
10907
10936
|
agent.command("status <parent-ref> <file>").description("Show .agent file metadata without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10908
10937
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10938
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10909
10939
|
const result = await requestAgentMarkdownStatus({
|
|
10910
10940
|
command: "osmd.agent.status",
|
|
10911
10941
|
runtimeOptions,
|
|
10912
10942
|
organizationId,
|
|
10913
|
-
path: normalizeAgentFilePath(file),
|
|
10914
|
-
parentRef:
|
|
10943
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
10944
|
+
parentRef: normalizedParentRef
|
|
10915
10945
|
});
|
|
10916
10946
|
return printEnvelopeAndExit({
|
|
10917
10947
|
envelope: buildSuccessEnvelope({
|
|
@@ -10938,12 +10968,13 @@ function registerOsmdCommands(program) {
|
|
|
10938
10968
|
});
|
|
10939
10969
|
agent.command("read <parent-ref> <file>").description("Read a .agent file without creating files").action(async (parentRef, file, _opts, cmd) => {
|
|
10940
10970
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10971
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10941
10972
|
const result = await requestAgentMarkdownFile({
|
|
10942
10973
|
command: "osmd.agent.read",
|
|
10943
10974
|
runtimeOptions,
|
|
10944
10975
|
organizationId,
|
|
10945
|
-
path: normalizeAgentFilePath(file),
|
|
10946
|
-
parentRef:
|
|
10976
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
10977
|
+
parentRef: normalizedParentRef
|
|
10947
10978
|
});
|
|
10948
10979
|
return printEnvelopeAndExit({
|
|
10949
10980
|
envelope: buildSuccessEnvelope({
|
|
@@ -10961,13 +10992,14 @@ function registerOsmdCommands(program) {
|
|
|
10961
10992
|
const globals = cmd.optsWithGlobals();
|
|
10962
10993
|
const content = await resolveContentInput(opts, globals);
|
|
10963
10994
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
10995
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10964
10996
|
return runWriteFlow({
|
|
10965
10997
|
command: "osmd.agent.create",
|
|
10966
10998
|
action: "create",
|
|
10967
10999
|
runtimeOptions,
|
|
10968
11000
|
organizationId,
|
|
10969
|
-
path: normalizeAgentFilePath(file),
|
|
10970
|
-
parentRef:
|
|
11001
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11002
|
+
parentRef: normalizedParentRef,
|
|
10971
11003
|
content
|
|
10972
11004
|
});
|
|
10973
11005
|
}
|
|
@@ -10979,13 +11011,14 @@ function registerOsmdCommands(program) {
|
|
|
10979
11011
|
const globals = cmd.optsWithGlobals();
|
|
10980
11012
|
const content = await resolveContentInput(opts, globals);
|
|
10981
11013
|
const { organizationId, runtimeOptions } = await resolveOsmdContext(cmd);
|
|
11014
|
+
const normalizedParentRef = nonEmptyString3.parse(parentRef).trim();
|
|
10982
11015
|
return runWriteFlow({
|
|
10983
11016
|
command: "osmd.agent.update",
|
|
10984
11017
|
action: "update",
|
|
10985
11018
|
runtimeOptions,
|
|
10986
11019
|
organizationId,
|
|
10987
|
-
path: normalizeAgentFilePath(file),
|
|
10988
|
-
parentRef:
|
|
11020
|
+
path: normalizeAgentFilePath(file, normalizedParentRef),
|
|
11021
|
+
parentRef: normalizedParentRef,
|
|
10989
11022
|
content
|
|
10990
11023
|
});
|
|
10991
11024
|
}
|