@lazehq/cli 0.1.137 → 0.1.139
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/laze.mjs +748 -245
- package/package.json +1 -1
package/dist/laze.mjs
CHANGED
|
@@ -12915,8 +12915,8 @@ var require_client_h2 = __commonJS({
|
|
|
12915
12915
|
}
|
|
12916
12916
|
this[kClient][kOnError](err);
|
|
12917
12917
|
}
|
|
12918
|
-
function onHttp2FrameError(type, code4,
|
|
12919
|
-
if (
|
|
12918
|
+
function onHttp2FrameError(type, code4, id9) {
|
|
12919
|
+
if (id9 === 0) {
|
|
12920
12920
|
if (this[kReceivedGoAway]) {
|
|
12921
12921
|
return;
|
|
12922
12922
|
}
|
|
@@ -31077,15 +31077,15 @@ ${value}`;
|
|
|
31077
31077
|
pos = 0;
|
|
31078
31078
|
}
|
|
31079
31079
|
}
|
|
31080
|
-
discardLeadingBytes(
|
|
31081
|
-
while (
|
|
31080
|
+
discardLeadingBytes(count16) {
|
|
31081
|
+
while (count16 > 0 && this.lineChunkIndex < this.chunks.length) {
|
|
31082
31082
|
const chunk = this.chunks[this.lineChunkIndex];
|
|
31083
31083
|
const remaining = chunk.length - this.linePos;
|
|
31084
|
-
if (
|
|
31085
|
-
this.linePos +=
|
|
31086
|
-
|
|
31084
|
+
if (count16 < remaining) {
|
|
31085
|
+
this.linePos += count16;
|
|
31086
|
+
count16 = 0;
|
|
31087
31087
|
} else {
|
|
31088
|
-
|
|
31088
|
+
count16 -= remaining;
|
|
31089
31089
|
this.lineChunkIndex++;
|
|
31090
31090
|
this.linePos = 0;
|
|
31091
31091
|
}
|
|
@@ -31675,8 +31675,8 @@ function holdsKeyRun(word3) {
|
|
|
31675
31675
|
}
|
|
31676
31676
|
function withoutLazeIds(text3) {
|
|
31677
31677
|
let held = false;
|
|
31678
|
-
const rest = text3.replace(LAZE_ID_INSIDE, (
|
|
31679
|
-
if (!isLazeId(
|
|
31678
|
+
const rest = text3.replace(LAZE_ID_INSIDE, (id9) => {
|
|
31679
|
+
if (!isLazeId(id9)) return id9;
|
|
31680
31680
|
held = true;
|
|
31681
31681
|
return "/";
|
|
31682
31682
|
});
|
|
@@ -31834,8 +31834,8 @@ function shannonEntropyBits(value) {
|
|
|
31834
31834
|
const counts = /* @__PURE__ */ new Map();
|
|
31835
31835
|
for (const char of sample) counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
31836
31836
|
let entropy = 0;
|
|
31837
|
-
for (const
|
|
31838
|
-
const p =
|
|
31837
|
+
for (const count16 of counts.values()) {
|
|
31838
|
+
const p = count16 / sample.length;
|
|
31839
31839
|
entropy -= p * Math.log2(p);
|
|
31840
31840
|
}
|
|
31841
31841
|
return entropy;
|
|
@@ -34733,8 +34733,8 @@ function queryTimeZone(rawTimeZoneId) {
|
|
|
34733
34733
|
}
|
|
34734
34734
|
var queryTimeZoneRecord = /* @__PURE__ */ memoize((normTimeZoneId, record5) => "named" === record5.kind ? new IntlTimeZone(normTimeZoneId, record5.m, record5.format) : new FixedTimeZone(normTimeZoneId, record5.m, "fixed" === record5.kind ? record5.X : 0));
|
|
34735
34735
|
var FixedTimeZone = class {
|
|
34736
|
-
constructor(
|
|
34737
|
-
this.id =
|
|
34736
|
+
constructor(id9, compareKey, offsetNano) {
|
|
34737
|
+
this.id = id9, this.m = compareKey, this.X = offsetNano;
|
|
34738
34738
|
}
|
|
34739
34739
|
B() {
|
|
34740
34740
|
return this.X;
|
|
@@ -34746,8 +34746,8 @@ var FixedTimeZone = class {
|
|
|
34746
34746
|
}
|
|
34747
34747
|
};
|
|
34748
34748
|
var IntlTimeZone = class {
|
|
34749
|
-
constructor(
|
|
34750
|
-
this.id =
|
|
34749
|
+
constructor(id9, compareKey, format2) {
|
|
34750
|
+
this.id = id9, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {
|
|
34751
34751
|
const getSample = memoize(computeOffsetSec);
|
|
34752
34752
|
const getSplit = memoize(createSplitTuple);
|
|
34753
34753
|
const periodSec = 86400 * periodDays;
|
|
@@ -34829,7 +34829,7 @@ var IntlTimeZone = class {
|
|
|
34829
34829
|
})(format2), ((timeZoneId) => {
|
|
34830
34830
|
const timeZoneName = timeZoneId.split("/").pop();
|
|
34831
34831
|
return timeZonePeriodDaysByName[timeZoneName] || 60;
|
|
34832
|
-
})(
|
|
34832
|
+
})(id9));
|
|
34833
34833
|
}
|
|
34834
34834
|
B(epochNano) {
|
|
34835
34835
|
return this.ke.we(((epochNano2) => epochNanoToSecMod(epochNano2)[0])(epochNano)) * nanoInSec2;
|
|
@@ -36970,7 +36970,7 @@ function shadowedLinkLineOf({ shadow }) {
|
|
|
36970
36970
|
}
|
|
36971
36971
|
|
|
36972
36972
|
// src/rules/cli-version.rules.ts
|
|
36973
|
-
var STAMPED = "0.1.
|
|
36973
|
+
var STAMPED = "0.1.139";
|
|
36974
36974
|
function cliVersionOf({ stamped = STAMPED } = {}) {
|
|
36975
36975
|
return stamped.startsWith("__") ? "dev" : stamped;
|
|
36976
36976
|
}
|
|
@@ -37545,6 +37545,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
|
|
|
37545
37545
|
"resend",
|
|
37546
37546
|
"replace",
|
|
37547
37547
|
"reset",
|
|
37548
|
+
"take-back",
|
|
37548
37549
|
"ask",
|
|
37549
37550
|
"real-value"
|
|
37550
37551
|
]);
|
|
@@ -38856,14 +38857,14 @@ function codePointLength(str) {
|
|
|
38856
38857
|
const units = str.length;
|
|
38857
38858
|
if (!highSurrogate.test(str))
|
|
38858
38859
|
return units;
|
|
38859
|
-
let
|
|
38860
|
+
let count16 = units;
|
|
38860
38861
|
for (let i = 0; i < units - 1; i++) {
|
|
38861
38862
|
if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
38862
|
-
|
|
38863
|
+
count16--;
|
|
38863
38864
|
i++;
|
|
38864
38865
|
}
|
|
38865
38866
|
}
|
|
38866
|
-
return
|
|
38867
|
+
return count16;
|
|
38867
38868
|
}
|
|
38868
38869
|
function getLengthableOrigin(input2) {
|
|
38869
38870
|
if (Array.isArray(input2))
|
|
@@ -41221,15 +41222,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41221
41222
|
const syms = normalized.symbolKeys;
|
|
41222
41223
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
41223
41224
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
41224
|
-
const prefixStr = (
|
|
41225
|
-
let ${
|
|
41226
|
-
for (let i = 0; i < ${
|
|
41227
|
-
const iss = ${
|
|
41225
|
+
const prefixStr = (id9, k) => `
|
|
41226
|
+
let ${id9}_ab = false;
|
|
41227
|
+
for (let i = 0; i < ${id9}.issues.length; i++) {
|
|
41228
|
+
const iss = ${id9}.issues[i];
|
|
41228
41229
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
41229
41230
|
payload.issues.push(iss);
|
|
41230
|
-
if (iss.continue !== true) ${
|
|
41231
|
+
if (iss.continue !== true) ${id9}_ab = true;
|
|
41231
41232
|
}
|
|
41232
|
-
if (${
|
|
41233
|
+
if (${id9}_ab && ctx && ctx.abortEarly) {
|
|
41233
41234
|
payload.value = newResult;
|
|
41234
41235
|
return payload;
|
|
41235
41236
|
}`;
|
|
@@ -41243,34 +41244,34 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41243
41244
|
for (const key of normalized.allKeys) {
|
|
41244
41245
|
if (key === "__proto__")
|
|
41245
41246
|
continue;
|
|
41246
|
-
const
|
|
41247
|
+
const id9 = ids[key];
|
|
41247
41248
|
const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
|
|
41248
41249
|
const isPresent = `${k} in input`;
|
|
41249
41250
|
const schema = shape[key];
|
|
41250
41251
|
const optin = schema?._zod?.optin;
|
|
41251
41252
|
const isOptionalIn = optin !== void 0;
|
|
41252
41253
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
41253
|
-
doc.write(`const ${
|
|
41254
|
+
doc.write(`const ${id9} = ${parseStr(k)};`);
|
|
41254
41255
|
if (isOptionalIn && isOptionalOut) {
|
|
41255
|
-
const assign = optin === "optional" ? `${
|
|
41256
|
+
const assign = optin === "optional" ? `${id9}_present` : `${id9}.value !== undefined || ${id9}_present`;
|
|
41256
41257
|
doc.write(`
|
|
41257
|
-
const ${
|
|
41258
|
-
if (!${
|
|
41259
|
-
if (${
|
|
41258
|
+
const ${id9}_present = ${isPresent};
|
|
41259
|
+
if (!${id9}.issues.length || ${id9}_present) {
|
|
41260
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
41260
41261
|
}
|
|
41261
41262
|
|
|
41262
41263
|
if (${assign}) {
|
|
41263
|
-
newResult[${k}] = ${
|
|
41264
|
+
newResult[${k}] = ${id9}.value;
|
|
41264
41265
|
}
|
|
41265
41266
|
}
|
|
41266
41267
|
|
|
41267
41268
|
`);
|
|
41268
41269
|
} else if (!isOptionalIn) {
|
|
41269
41270
|
doc.write(`
|
|
41270
|
-
const ${
|
|
41271
|
-
if (${
|
|
41271
|
+
const ${id9}_present = ${isPresent};
|
|
41272
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
41272
41273
|
}
|
|
41273
|
-
if (!${
|
|
41274
|
+
if (!${id9}_present && !${id9}.issues.length) {
|
|
41274
41275
|
payload.issues.push({
|
|
41275
41276
|
code: "invalid_type",
|
|
41276
41277
|
expected: "nonoptional",
|
|
@@ -41283,22 +41284,22 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
41283
41284
|
}
|
|
41284
41285
|
}
|
|
41285
41286
|
|
|
41286
|
-
if (${
|
|
41287
|
-
newResult[${k}] = ${
|
|
41287
|
+
if (${id9}_present) {
|
|
41288
|
+
newResult[${k}] = ${id9}.value;
|
|
41288
41289
|
}
|
|
41289
41290
|
|
|
41290
41291
|
`);
|
|
41291
41292
|
} else {
|
|
41292
41293
|
doc.write(`
|
|
41293
|
-
if (${
|
|
41294
|
+
if (${id9}.issues.length) {${prefixStr(id9, k)}
|
|
41294
41295
|
}
|
|
41295
41296
|
`);
|
|
41296
41297
|
if (optin === "defaulted") {
|
|
41297
|
-
doc.write(`newResult[${k}] = ${
|
|
41298
|
+
doc.write(`newResult[${k}] = ${id9}.value;`);
|
|
41298
41299
|
} else {
|
|
41299
41300
|
doc.write(`
|
|
41300
|
-
if (${
|
|
41301
|
-
newResult[${k}] = ${
|
|
41301
|
+
if (${id9}.value !== undefined || ${isPresent}) {
|
|
41302
|
+
newResult[${k}] = ${id9}.value;
|
|
41302
41303
|
}
|
|
41303
41304
|
`);
|
|
41304
41305
|
}
|
|
@@ -43218,8 +43219,8 @@ function az_default() {
|
|
|
43218
43219
|
}
|
|
43219
43220
|
|
|
43220
43221
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
|
|
43221
|
-
function getBelarusianPlural(
|
|
43222
|
-
const absCount = Math.abs(
|
|
43222
|
+
function getBelarusianPlural(count16, one, few, many) {
|
|
43223
|
+
const absCount = Math.abs(count16);
|
|
43223
43224
|
const lastDigit = absCount % 10;
|
|
43224
43225
|
const lastTwoDigits = absCount % 100;
|
|
43225
43226
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -45866,8 +45867,8 @@ function hu_default() {
|
|
|
45866
45867
|
}
|
|
45867
45868
|
|
|
45868
45869
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
|
|
45869
|
-
function getArmenianPlural(
|
|
45870
|
-
return Math.abs(
|
|
45870
|
+
function getArmenianPlural(count16, one, many) {
|
|
45871
|
+
return Math.abs(count16) === 1 ? one : many;
|
|
45871
45872
|
}
|
|
45872
45873
|
function withDefiniteArticle(word3) {
|
|
45873
45874
|
if (!word3)
|
|
@@ -48605,8 +48606,8 @@ function ro_default() {
|
|
|
48605
48606
|
}
|
|
48606
48607
|
|
|
48607
48608
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
|
|
48608
|
-
function getRussianPlural(
|
|
48609
|
-
const absCount = Math.abs(
|
|
48609
|
+
function getRussianPlural(count16, one, few, many) {
|
|
48610
|
+
const absCount = Math.abs(count16);
|
|
48610
48611
|
const lastDigit = absCount % 10;
|
|
48611
48612
|
const lastTwoDigits = absCount % 100;
|
|
48612
48613
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -53316,26 +53317,26 @@ function extractDefs(ctx, schema) {
|
|
|
53316
53317
|
return;
|
|
53317
53318
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
53318
53319
|
for (const entry2 of ctx.seen.entries()) {
|
|
53319
|
-
const
|
|
53320
|
-
if (
|
|
53321
|
-
const existing = idToSchema.get(
|
|
53320
|
+
const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
53321
|
+
if (id9) {
|
|
53322
|
+
const existing = idToSchema.get(id9);
|
|
53322
53323
|
if (existing && existing !== entry2[0]) {
|
|
53323
|
-
throw new Error(`Duplicate schema id "${
|
|
53324
|
+
throw new Error(`Duplicate schema id "${id9}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
53324
53325
|
}
|
|
53325
|
-
idToSchema.set(
|
|
53326
|
+
idToSchema.set(id9, entry2[0]);
|
|
53326
53327
|
}
|
|
53327
53328
|
}
|
|
53328
53329
|
const makeURI = (entry2) => {
|
|
53329
53330
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
53330
53331
|
if (ctx.external) {
|
|
53331
53332
|
const externalId = ctx.external.registry.get(entry2[0])?.id;
|
|
53332
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
53333
|
+
const uriGenerator = ctx.external.uri ?? ((id10) => id10);
|
|
53333
53334
|
if (externalId) {
|
|
53334
53335
|
return { ref: uriGenerator(externalId) };
|
|
53335
53336
|
}
|
|
53336
|
-
const
|
|
53337
|
-
entry2[1].defId =
|
|
53338
|
-
return { defId:
|
|
53337
|
+
const id9 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
|
|
53338
|
+
entry2[1].defId = id9;
|
|
53339
|
+
return { defId: id9, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id9)}` };
|
|
53339
53340
|
}
|
|
53340
53341
|
const uriPrefix = `#`;
|
|
53341
53342
|
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
@@ -53383,8 +53384,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
53383
53384
|
continue;
|
|
53384
53385
|
}
|
|
53385
53386
|
}
|
|
53386
|
-
const
|
|
53387
|
-
if (
|
|
53387
|
+
const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
|
|
53388
|
+
if (id9) {
|
|
53388
53389
|
extractToDef(entry2);
|
|
53389
53390
|
continue;
|
|
53390
53391
|
}
|
|
@@ -53617,10 +53618,10 @@ function finalize(ctx, schema) {
|
|
|
53617
53618
|
} else {
|
|
53618
53619
|
}
|
|
53619
53620
|
if (ctx.external?.uri) {
|
|
53620
|
-
const
|
|
53621
|
-
if (!
|
|
53621
|
+
const id9 = ctx.external.registry.get(schema)?.id;
|
|
53622
|
+
if (!id9)
|
|
53622
53623
|
throw new Error("Schema is missing an `id` property");
|
|
53623
|
-
result2.$id = ctx.external.uri(
|
|
53624
|
+
result2.$id = ctx.external.uri(id9);
|
|
53624
53625
|
}
|
|
53625
53626
|
assignProps(result2, root.defId ? root.schema : root.def ?? root.schema);
|
|
53626
53627
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -54226,7 +54227,7 @@ function stringifyKeyNames(bySchema, json7, visited) {
|
|
|
54226
54227
|
const values = json7.enum ?? (json7.const !== void 0 ? [json7.const] : void 0);
|
|
54227
54228
|
if (!numericType && !values?.some((v) => typeof v === "number"))
|
|
54228
54229
|
return json7;
|
|
54229
|
-
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id:
|
|
54230
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id: id9, ...rest } = json7;
|
|
54230
54231
|
if (rest.enum)
|
|
54231
54232
|
rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
54232
54233
|
else if (typeof rest.const === "number")
|
|
@@ -58108,12 +58109,12 @@ var isHex = new Uint8Array([
|
|
|
58108
58109
|
1,
|
|
58109
58110
|
1
|
|
58110
58111
|
]);
|
|
58111
|
-
function isValidHex(
|
|
58112
|
-
if (typeof
|
|
58112
|
+
function isValidHex(id9, length) {
|
|
58113
|
+
if (typeof id9 !== "string" || id9.length !== length)
|
|
58113
58114
|
return false;
|
|
58114
58115
|
let r = 0;
|
|
58115
|
-
for (let i = 0; i <
|
|
58116
|
-
r += (isHex[
|
|
58116
|
+
for (let i = 0; i < id9.length; i += 4) {
|
|
58117
|
+
r += (isHex[id9.charCodeAt(i)] | 0) + (isHex[id9.charCodeAt(i + 1)] | 0) + (isHex[id9.charCodeAt(i + 2)] | 0) + (isHex[id9.charCodeAt(i + 3)] | 0);
|
|
58117
58118
|
}
|
|
58118
58119
|
return r === length;
|
|
58119
58120
|
}
|
|
@@ -59564,7 +59565,7 @@ var ModuleApiToken = class _ModuleApiToken extends FeatureApiIdentity {
|
|
|
59564
59565
|
};
|
|
59565
59566
|
function moduleApi(name3) {
|
|
59566
59567
|
if (name3 === void 0) {
|
|
59567
|
-
return (
|
|
59568
|
+
return (id9) => ModuleApiToken.create(id9);
|
|
59568
59569
|
}
|
|
59569
59570
|
return ModuleApiToken.create(name3);
|
|
59570
59571
|
}
|
|
@@ -62065,15 +62066,15 @@ function clustersIn({
|
|
|
62065
62066
|
const out = [];
|
|
62066
62067
|
let current3 = null;
|
|
62067
62068
|
for (let index = segment.start; index <= segment.end; index += 1) {
|
|
62068
|
-
const
|
|
62069
|
-
if (
|
|
62069
|
+
const count16 = flagged[index] ?? 0;
|
|
62070
|
+
if (count16 === 0) continue;
|
|
62070
62071
|
if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
|
|
62071
62072
|
current3.end = index;
|
|
62072
|
-
current3.values +=
|
|
62073
|
+
current3.values += count16;
|
|
62073
62074
|
continue;
|
|
62074
62075
|
}
|
|
62075
62076
|
if (current3) out.push(current3);
|
|
62076
|
-
current3 = { start: index, end: index, values:
|
|
62077
|
+
current3 = { start: index, end: index, values: count16 };
|
|
62077
62078
|
}
|
|
62078
62079
|
if (current3) out.push(current3);
|
|
62079
62080
|
return out;
|
|
@@ -62113,7 +62114,7 @@ function redactedBlocksAt({
|
|
|
62113
62114
|
}
|
|
62114
62115
|
const blocks = redactedBlocks({ lines: lines2, flagged });
|
|
62115
62116
|
const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
|
|
62116
|
-
const values = flagged.reduce((sum,
|
|
62117
|
+
const values = flagged.reduce((sum, count16, line) => inside(line) ? sum + count16 : sum, 0);
|
|
62117
62118
|
return { values, insideAt: (offset) => inside(lineAt(offset)) };
|
|
62118
62119
|
}
|
|
62119
62120
|
|
|
@@ -69257,7 +69258,7 @@ var NAMING_FREE_CLI_COMMANDS = [
|
|
|
69257
69258
|
];
|
|
69258
69259
|
var NAMING_IS_SILENT = "Naming or renaming a conversation is silent: never post a message about it.";
|
|
69259
69260
|
function namingReminderTextOf({ channelIds }) {
|
|
69260
|
-
const lines2 = channelIds.map((
|
|
69261
|
+
const lines2 = channelIds.map((id9) => ` laze conversation rename ${id9} "<a few words>"`);
|
|
69261
69262
|
return [
|
|
69262
69263
|
"Your new conversation has no name yet. Name it in a few words that say what it is about:",
|
|
69263
69264
|
...lines2,
|
|
@@ -73712,10 +73713,20 @@ function errorOf({ status: status11, body }) {
|
|
|
73712
73713
|
const code4 = typeof nested.code === "string" ? nested.code : fallback;
|
|
73713
73714
|
const message2 = typeof nested.message === "string" ? nested.message : `Laze answered ${status11}`;
|
|
73714
73715
|
const meta3 = typeof nested.meta === "object" && nested.meta !== null ? nested.meta : void 0;
|
|
73715
|
-
const
|
|
73716
|
+
const reasons = reasonLines(nested);
|
|
73717
|
+
const said = reasons.length > 0 ? `${message2.replace(/\.$/, "")}. ${reasons.join("; ")}` : message2;
|
|
73718
|
+
const error63 = new LazeApiError(status11, code4, said);
|
|
73716
73719
|
error63.meta = meta3;
|
|
73717
73720
|
return error63;
|
|
73718
73721
|
}
|
|
73722
|
+
function reasonLines(error63) {
|
|
73723
|
+
const reasons = Array.isArray(error63.reasons) ? error63.reasons : [];
|
|
73724
|
+
return reasons.flatMap((reason2) => {
|
|
73725
|
+
const meta3 = reason2?.meta;
|
|
73726
|
+
if (typeof meta3?.message !== "string") return [];
|
|
73727
|
+
return [typeof meta3.field === "string" ? `${meta3.field}: ${meta3.message}` : meta3.message];
|
|
73728
|
+
});
|
|
73729
|
+
}
|
|
73719
73730
|
|
|
73720
73731
|
// src/services/machine-report.service.ts
|
|
73721
73732
|
import { createHash } from "node:crypto";
|
|
@@ -74337,10 +74348,10 @@ function whereOf(message2) {
|
|
|
74337
74348
|
}
|
|
74338
74349
|
function catchUpLinesOf(message2) {
|
|
74339
74350
|
if (!message2.catchUp) return [];
|
|
74340
|
-
const { count:
|
|
74351
|
+
const { count: count16, older } = message2.catchUp;
|
|
74341
74352
|
const where = whereOf(message2);
|
|
74342
74353
|
const lines2 = [
|
|
74343
|
-
`${
|
|
74354
|
+
`${count16} ${count16 === 1 ? "message" : "messages"} in ${where} while you were away.`
|
|
74344
74355
|
];
|
|
74345
74356
|
if (older === 0) return lines2;
|
|
74346
74357
|
const channel = message2.channelKind === "public" || message2.channelKind === "private";
|
|
@@ -74368,9 +74379,9 @@ function hookContextOf({
|
|
|
74368
74379
|
messages,
|
|
74369
74380
|
self: self2
|
|
74370
74381
|
}) {
|
|
74371
|
-
const
|
|
74382
|
+
const count16 = messages.length === 1 ? "A message" : `${messages.length} messages`;
|
|
74372
74383
|
return [
|
|
74373
|
-
`${
|
|
74384
|
+
`${count16} reached you in Laze${selfClauseOf({ self: self2 })}:`,
|
|
74374
74385
|
"",
|
|
74375
74386
|
...messages.map((message2) => formatInboxMessage({ message: message2 })),
|
|
74376
74387
|
"",
|
|
@@ -75372,10 +75383,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
|
|
|
75372
75383
|
function minutesOf({ text: text3 }) {
|
|
75373
75384
|
const match = DURATION.exec(text3.trim());
|
|
75374
75385
|
if (!match?.[1] || !match[2]) return null;
|
|
75375
|
-
const
|
|
75386
|
+
const count16 = Number(match[1]);
|
|
75376
75387
|
const unit = match[2].toLowerCase()[0];
|
|
75377
75388
|
const perUnit = { d: 1440, h: 60, m: 1 };
|
|
75378
|
-
const minutes =
|
|
75389
|
+
const minutes = count16 * (perUnit[unit ?? "m"] ?? 1);
|
|
75379
75390
|
return minutes > 0 ? minutes : null;
|
|
75380
75391
|
}
|
|
75381
75392
|
function muteTextOf({ mute }) {
|
|
@@ -75458,17 +75469,17 @@ function bodyAsText({
|
|
|
75458
75469
|
body,
|
|
75459
75470
|
mentions
|
|
75460
75471
|
}) {
|
|
75461
|
-
const actorName = (kind2,
|
|
75472
|
+
const actorName = (kind2, id9) => mentions.actors.find((actor) => actor.kind === kind2 && actor.id === id9)?.name ?? kind2;
|
|
75462
75473
|
const written = withSlackMarkupAsText(body);
|
|
75463
75474
|
let text3 = "";
|
|
75464
75475
|
let from = 0;
|
|
75465
75476
|
for (const token2 of written.matchAll(TOKEN)) {
|
|
75466
|
-
const [whole, kind2,
|
|
75477
|
+
const [whole, kind2, id9, broadcast, channelId] = token2;
|
|
75467
75478
|
text3 += plain2(written.slice(from, token2.index));
|
|
75468
75479
|
from = token2.index + whole.length;
|
|
75469
75480
|
if (channelId) {
|
|
75470
75481
|
text3 += `#${mentions.channels.find((channel) => channel.id === channelId)?.name ?? "channel"}`;
|
|
75471
|
-
} else if (kind2 &&
|
|
75482
|
+
} else if (kind2 && id9) text3 += `@${actorName(kind2, id9)}`;
|
|
75472
75483
|
else text3 += `@${broadcast ?? "channel"}`;
|
|
75473
75484
|
}
|
|
75474
75485
|
text3 += plain2(written.slice(from));
|
|
@@ -75647,12 +75658,12 @@ function rushSessionOf({
|
|
|
75647
75658
|
parentArgs
|
|
75648
75659
|
}) {
|
|
75649
75660
|
if (!parentArgs) return void 0;
|
|
75650
|
-
const [program = "", verb, action,
|
|
75651
|
-
if (!program || !
|
|
75652
|
-
return HOST_ACTIONS.has(action ?? "") ? { id:
|
|
75661
|
+
const [program = "", verb, action, id9] = parentArgs;
|
|
75662
|
+
if (!program || !id9 || verb !== "host") return void 0;
|
|
75663
|
+
return HOST_ACTIONS.has(action ?? "") ? { id: id9, program } : void 0;
|
|
75653
75664
|
}
|
|
75654
|
-
function rushSendCommand({ program, id:
|
|
75655
|
-
return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program,
|
|
75665
|
+
function rushSendCommand({ program, id: id9 }) {
|
|
75666
|
+
return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program, id9];
|
|
75656
75667
|
}
|
|
75657
75668
|
function rushListedOf({ listed }) {
|
|
75658
75669
|
try {
|
|
@@ -76539,14 +76550,14 @@ async function scheduleMessage({
|
|
|
76539
76550
|
var USAGE = "Usage: laze scheduled [--channel <channel>] [--json], laze scheduled send|cancel <id>, laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]";
|
|
76540
76551
|
var EDIT_USAGE = "Usage: laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]; give the text, the time or both";
|
|
76541
76552
|
async function scheduled({ context, args }) {
|
|
76542
|
-
const [, action,
|
|
76553
|
+
const [, action, id9] = args.words;
|
|
76543
76554
|
if (action === "send" || action === "cancel") {
|
|
76544
|
-
if (!
|
|
76545
|
-
return actOn({ context, args, action, id:
|
|
76555
|
+
if (!id9) throw new CliUsageError(USAGE);
|
|
76556
|
+
return actOn({ context, args, action, id: id9 });
|
|
76546
76557
|
}
|
|
76547
76558
|
if (action === "edit") {
|
|
76548
|
-
if (!
|
|
76549
|
-
return editOne({ context, args, id:
|
|
76559
|
+
if (!id9) throw new CliUsageError(EDIT_USAGE);
|
|
76560
|
+
return editOne({ context, args, id: id9 });
|
|
76550
76561
|
}
|
|
76551
76562
|
if (action !== void 0) throw new CliUsageError(USAGE);
|
|
76552
76563
|
const { client } = await signedIn({ context, args });
|
|
@@ -76572,14 +76583,14 @@ async function newTextOf({
|
|
|
76572
76583
|
async function editOne({
|
|
76573
76584
|
context,
|
|
76574
76585
|
args,
|
|
76575
|
-
id:
|
|
76586
|
+
id: id9
|
|
76576
76587
|
}) {
|
|
76577
76588
|
const at8 = scheduleAtOf({ args, usage: EDIT_USAGE });
|
|
76578
76589
|
const body = await newTextOf({ context, args });
|
|
76579
76590
|
if (!at8 && body === void 0) throw new CliUsageError(EDIT_USAGE);
|
|
76580
76591
|
const { client } = await signedIn({ context, args });
|
|
76581
76592
|
const edited = await client.post("/api/agents/me/scheduled/edit", {
|
|
76582
|
-
scheduledId:
|
|
76593
|
+
scheduledId: id9,
|
|
76583
76594
|
...body === void 0 ? {} : { body },
|
|
76584
76595
|
...at8 ? { sendAt: at8.sendAt } : {}
|
|
76585
76596
|
});
|
|
@@ -76592,11 +76603,11 @@ async function actOn({
|
|
|
76592
76603
|
context,
|
|
76593
76604
|
args,
|
|
76594
76605
|
action,
|
|
76595
|
-
id:
|
|
76606
|
+
id: id9
|
|
76596
76607
|
}) {
|
|
76597
76608
|
const { client } = await signedIn({ context, args });
|
|
76598
76609
|
const done = await client.post(`/api/agents/me/scheduled/${action}`, {
|
|
76599
|
-
scheduledId:
|
|
76610
|
+
scheduledId: id9
|
|
76600
76611
|
});
|
|
76601
76612
|
if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
|
|
76602
76613
|
`);
|
|
@@ -76764,7 +76775,7 @@ function leavesLazeOf({
|
|
|
76764
76775
|
}
|
|
76765
76776
|
function turnAnswersOf({ context }) {
|
|
76766
76777
|
const listed = context.environment.inherited.LAZE_TURN_MESSAGES ?? "";
|
|
76767
|
-
const answers = listed.split(",").flatMap((
|
|
76778
|
+
const answers = listed.split(",").flatMap((id9) => id9.trim() ? [id9.trim()] : []);
|
|
76768
76779
|
return answers.length > 0 ? { answers } : {};
|
|
76769
76780
|
}
|
|
76770
76781
|
var FILES_USAGE = "[--image <path|url|fileId>]... [--file <path|url|fileId>]... (at most 6)";
|
|
@@ -77218,7 +77229,7 @@ function rolloutEventOf({
|
|
|
77218
77229
|
if (type === "task_complete" || type === "turn_aborted") return { kind: "ended" };
|
|
77219
77230
|
const text3 = userTextOf({ parsed });
|
|
77220
77231
|
if (text3 === void 0) return void 0;
|
|
77221
|
-
const held = messageIds.filter((
|
|
77232
|
+
const held = messageIds.filter((id9) => text3.includes(`[${id9}]`));
|
|
77222
77233
|
return held.length > 0 ? { kind: "holds", messageIds: held } : void 0;
|
|
77223
77234
|
}
|
|
77224
77235
|
|
|
@@ -77308,8 +77319,8 @@ var CodexTurnWatch = class _CodexTurnWatch {
|
|
|
77308
77319
|
async #follow({ line }) {
|
|
77309
77320
|
const event = rolloutEventOf({ line, messageIds: [...this.#queued.keys()] });
|
|
77310
77321
|
if (event?.kind === "holds") {
|
|
77311
|
-
const held = event.messageIds.flatMap((
|
|
77312
|
-
for (const
|
|
77322
|
+
const held = event.messageIds.flatMap((id9) => this.#queued.get(id9) ?? []);
|
|
77323
|
+
for (const id9 of event.messageIds) this.#queued.delete(id9);
|
|
77313
77324
|
this.#answering = [...this.#answering, ...held];
|
|
77314
77325
|
await this.#tell({ working: true });
|
|
77315
77326
|
} else if (event?.kind === "ended" && this.#answering.length > 0) {
|
|
@@ -77599,8 +77610,8 @@ var answer = (status11, value) => ({
|
|
|
77599
77610
|
headers: value === void 0 ? {} : JSON_HEADERS,
|
|
77600
77611
|
body: value === void 0 ? "" : JSON.stringify(value)
|
|
77601
77612
|
});
|
|
77602
|
-
var result = (
|
|
77603
|
-
var error62 = (
|
|
77613
|
+
var result = (id9, value) => answer(200, { jsonrpc: "2.0", id: id9, result: value });
|
|
77614
|
+
var error62 = (id9, code4, message2) => answer(200, { jsonrpc: "2.0", id: id9 ?? null, error: { code: code4, message: message2 } });
|
|
77604
77615
|
function headerOf(headers, name3) {
|
|
77605
77616
|
const found = Object.entries(headers).find(([key]) => key.toLowerCase() === name3);
|
|
77606
77617
|
return found?.[1];
|
|
@@ -79464,10 +79475,10 @@ var CodexAppServer = class _CodexAppServer {
|
|
|
79464
79475
|
return new _CodexAppServer(spawn2("codex", ["app-server"], { env, stdio: "pipe" }));
|
|
79465
79476
|
}
|
|
79466
79477
|
async call(method, params) {
|
|
79467
|
-
const
|
|
79478
|
+
const id9 = ++this.#nextId;
|
|
79468
79479
|
const reply3 = await new Promise((resolve29) => {
|
|
79469
|
-
this.#pending.set(
|
|
79470
|
-
this.write({ id:
|
|
79480
|
+
this.#pending.set(id9, resolve29);
|
|
79481
|
+
this.write({ id: id9, method, params });
|
|
79471
79482
|
});
|
|
79472
79483
|
if (reply3.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply3.error)}`);
|
|
79473
79484
|
return record4(reply3.result);
|
|
@@ -79533,9 +79544,9 @@ async function newestThreadId({ codexHome }) {
|
|
|
79533
79544
|
rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join19(root, file4))).mtimeMs }))
|
|
79534
79545
|
);
|
|
79535
79546
|
const newest = dated.toSorted((a, b) => b.at - a.at)[0]?.file ?? "";
|
|
79536
|
-
const
|
|
79537
|
-
if (!
|
|
79538
|
-
return
|
|
79547
|
+
const id9 = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
|
|
79548
|
+
if (!id9?.[1]) throw new CliUsageError("No Codex session found: pass --thread <id>.");
|
|
79549
|
+
return id9[1];
|
|
79539
79550
|
}
|
|
79540
79551
|
function promptOf({ message: message2, self: self2 }) {
|
|
79541
79552
|
return [
|
|
@@ -82245,8 +82256,8 @@ async function uploadTranscript({ context, args, client }) {
|
|
|
82245
82256
|
args,
|
|
82246
82257
|
usage: "Usage: laze agent migrate upload <migrationId>"
|
|
82247
82258
|
});
|
|
82248
|
-
const
|
|
82249
|
-
const ticket = await client.get(`/api/agents/me/migrations/${
|
|
82259
|
+
const id9 = encodeURIComponent(migrationId);
|
|
82260
|
+
const ticket = await client.get(`/api/agents/me/migrations/${id9}`);
|
|
82250
82261
|
if (ticket.status === "cancelled") {
|
|
82251
82262
|
throw new CliUsageError("This migration was cancelled; nothing was uploaded.");
|
|
82252
82263
|
}
|
|
@@ -82265,10 +82276,10 @@ async function uploadTranscript({ context, args, client }) {
|
|
|
82265
82276
|
maxParts: Math.min(ticket.partsMax, MIGRATION_PARTS_MAX)
|
|
82266
82277
|
});
|
|
82267
82278
|
const upload = { parts, truncated, redactions: redacted.redactions };
|
|
82268
|
-
await uploadParts({ client, migrationId:
|
|
82279
|
+
await uploadParts({ client, migrationId: id9, upload });
|
|
82269
82280
|
const fileName = basename6(found.path);
|
|
82270
82281
|
const completed = await client.post(
|
|
82271
|
-
`/api/agents/me/migrations/${
|
|
82282
|
+
`/api/agents/me/migrations/${id9}/complete`,
|
|
82272
82283
|
{
|
|
82273
82284
|
parts: parts.length,
|
|
82274
82285
|
sha256: sha256Of({ text: parts.join("") }),
|
|
@@ -86644,7 +86655,7 @@ async function appPinsCommand({
|
|
|
86644
86655
|
if (!channel) throw new CliUsageError(USAGE5);
|
|
86645
86656
|
const client = await signed2();
|
|
86646
86657
|
const order = flagText({ args, name: "order" });
|
|
86647
|
-
const appIds = order.split(",").map((
|
|
86658
|
+
const appIds = order.split(",").map((id9) => id9.trim()).filter(Boolean);
|
|
86648
86659
|
const listed = appIds.length ? await client.post("/api/apps/pins/order", { channel, appIds }) : await client.post("/api/apps/pins", { channel });
|
|
86649
86660
|
print3({ context, args, value: listed, text: pinsText({ channel, listed }) });
|
|
86650
86661
|
}
|
|
@@ -87288,7 +87299,7 @@ var appWrite = async ({ context, args }) => {
|
|
|
87288
87299
|
);
|
|
87289
87300
|
}
|
|
87290
87301
|
const folder = folderOf({ context, word: void 0 });
|
|
87291
|
-
const
|
|
87302
|
+
const remove11 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
|
|
87292
87303
|
const files3 = await Promise.all(
|
|
87293
87304
|
words.slice(2).map(async (word3) => {
|
|
87294
87305
|
const path = resolve9(context.cwd, word3);
|
|
@@ -87299,7 +87310,7 @@ var appWrite = async ({ context, args }) => {
|
|
|
87299
87310
|
return file4;
|
|
87300
87311
|
})
|
|
87301
87312
|
);
|
|
87302
|
-
if (files3.length +
|
|
87313
|
+
if (files3.length + remove11.length === 0) {
|
|
87303
87314
|
throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
|
|
87304
87315
|
}
|
|
87305
87316
|
const client = await appClient({ context, args });
|
|
@@ -87307,19 +87318,19 @@ var appWrite = async ({ context, args }) => {
|
|
|
87307
87318
|
const { publish, ...version2 } = await client.post("/api/apps/files/write", {
|
|
87308
87319
|
appId,
|
|
87309
87320
|
files: files3,
|
|
87310
|
-
remove:
|
|
87321
|
+
remove: remove11,
|
|
87311
87322
|
message: message2
|
|
87312
87323
|
});
|
|
87313
87324
|
print5({
|
|
87314
87325
|
context,
|
|
87315
87326
|
args,
|
|
87316
87327
|
value: { version: version2, app: publish.app, publish },
|
|
87317
|
-
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${
|
|
87328
|
+
text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${remove11.length} removed)
|
|
87318
87329
|
` + publishLine(publish)
|
|
87319
87330
|
});
|
|
87320
87331
|
};
|
|
87321
87332
|
function seedLine(seeded) {
|
|
87322
|
-
const created = Object.entries(seeded.created).map(([name3,
|
|
87333
|
+
const created = Object.entries(seeded.created).map(([name3, count16]) => `${count16} in ${name3}`);
|
|
87323
87334
|
const parts = [
|
|
87324
87335
|
created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
|
|
87325
87336
|
seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
|
|
@@ -87645,8 +87656,8 @@ function cardLine({ choice }) {
|
|
|
87645
87656
|
var appCard = async ({ context, args }) => {
|
|
87646
87657
|
const client = await appClient({ context, args });
|
|
87647
87658
|
const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
|
|
87648
|
-
const
|
|
87649
|
-
if (!Number.isInteger(
|
|
87659
|
+
const count16 = Number(flagText({ args, name: "rows", fallback: "5" }));
|
|
87660
|
+
if (!Number.isInteger(count16) || count16 < 1 || count16 > 10) {
|
|
87650
87661
|
throw new CliUsageError("--rows is a whole number from 1 to 10");
|
|
87651
87662
|
}
|
|
87652
87663
|
const text3 = (name3) => flagText({ args, name: name3 }) || null;
|
|
@@ -87659,7 +87670,7 @@ var appCard = async ({ context, args }) => {
|
|
|
87659
87670
|
collection: text3("collection"),
|
|
87660
87671
|
filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
|
|
87661
87672
|
sort: flagText({ args, name: "sort" }),
|
|
87662
|
-
rows:
|
|
87673
|
+
rows: count16,
|
|
87663
87674
|
caption: text3("caption")
|
|
87664
87675
|
}
|
|
87665
87676
|
});
|
|
@@ -87840,11 +87851,11 @@ function isSubjectType(type) {
|
|
|
87840
87851
|
}
|
|
87841
87852
|
function subjectOf(word3) {
|
|
87842
87853
|
const [type, ...rest] = (word3 ?? "").split(":");
|
|
87843
|
-
const
|
|
87844
|
-
if (!isSubjectType(type) || !
|
|
87854
|
+
const id9 = rest.join(":");
|
|
87855
|
+
if (!isSubjectType(type) || !id9) {
|
|
87845
87856
|
throw new CliUsageError("Name who with user:<id>, agent:<id>, channel:<id> or group:<id>");
|
|
87846
87857
|
}
|
|
87847
|
-
return { type, id:
|
|
87858
|
+
return { type, id: id9 };
|
|
87848
87859
|
}
|
|
87849
87860
|
function agentPathText(path) {
|
|
87850
87861
|
if (!path) return "you cannot open the app yourself, so you cannot let it in";
|
|
@@ -89354,9 +89365,9 @@ function presenceColumns(member) {
|
|
|
89354
89365
|
return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
|
|
89355
89366
|
}
|
|
89356
89367
|
function formatMembers({ detail }) {
|
|
89357
|
-
const
|
|
89368
|
+
const count16 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
|
|
89358
89369
|
const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
|
|
89359
|
-
const head = `${channelLabelOf(detail)} (${detail.id}), ${
|
|
89370
|
+
const head = `${channelLabelOf(detail)} (${detail.id}), ${count16}${ends}`;
|
|
89360
89371
|
const rows = detail.members.map(
|
|
89361
89372
|
(member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
|
|
89362
89373
|
);
|
|
@@ -89396,13 +89407,13 @@ function formatBrowsable({
|
|
|
89396
89407
|
}) {
|
|
89397
89408
|
if (channels3.length === 0) return "No channels to browse.\n";
|
|
89398
89409
|
const rows = channels3.map((channel) => {
|
|
89399
|
-
const
|
|
89410
|
+
const count16 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
|
|
89400
89411
|
const marks = [
|
|
89401
89412
|
channel.joined ? "joined" : "not joined",
|
|
89402
89413
|
...channel.private ? ["private"] : [],
|
|
89403
89414
|
...channel.archived ? ["archived"] : []
|
|
89404
89415
|
].join(", ");
|
|
89405
|
-
const text3 = `#${channel.name} ${channel.id} ${
|
|
89416
|
+
const text3 = `#${channel.name} ${channel.id} ${count16} ${marks} ${channel.topic}`;
|
|
89406
89417
|
return withLink({ text: text3, url: channel.url, base });
|
|
89407
89418
|
});
|
|
89408
89419
|
return `${rows.join("\n")}
|
|
@@ -90957,7 +90968,7 @@ var billingConfig = Config.define((c) => ({
|
|
|
90957
90968
|
earlierTeamPriceIds: c.env(
|
|
90958
90969
|
"STRIPE_PRICES_TEAM_EARLIER",
|
|
90959
90970
|
external_exports.string().optional().transform(
|
|
90960
|
-
(value) => (value ?? "").split(",").map((
|
|
90971
|
+
(value) => (value ?? "").split(",").map((id9) => id9.trim()).filter(Boolean)
|
|
90961
90972
|
)
|
|
90962
90973
|
),
|
|
90963
90974
|
/** The product every top-up and auto-recharge line names; a bare line without it. */
|
|
@@ -90983,7 +90994,7 @@ var billingConfig = Config.define((c) => ({
|
|
|
90983
90994
|
qaWorkspaceIds: c.env(
|
|
90984
90995
|
"LAZE_BILLING_QA_WORKSPACES",
|
|
90985
90996
|
external_exports.string().default(MAC_QA_WORKSPACE_ID).transform(
|
|
90986
|
-
(value) => value.split(",").map((
|
|
90997
|
+
(value) => value.split(",").map((id9) => id9.trim()).filter(Boolean)
|
|
90987
90998
|
)
|
|
90988
90999
|
),
|
|
90989
91000
|
/** USD per euro until the first ECB rate is stored. */
|
|
@@ -94024,11 +94035,11 @@ async function answerSupportLine({
|
|
|
94024
94035
|
} catch {
|
|
94025
94036
|
return rpc(null, { error: { code: -32700, message: "Parse error" } });
|
|
94026
94037
|
}
|
|
94027
|
-
const { id:
|
|
94028
|
-
if (
|
|
94038
|
+
const { id: id9, method } = request2;
|
|
94039
|
+
if (id9 === void 0 || id9 === null) return "";
|
|
94029
94040
|
const params = recordOf3(request2.params);
|
|
94030
94041
|
if (method === "initialize") {
|
|
94031
|
-
return rpc(
|
|
94042
|
+
return rpc(id9, {
|
|
94032
94043
|
result: {
|
|
94033
94044
|
protocolVersion: typeof params.protocolVersion === "string" ? params.protocolVersion : "2025-06-18",
|
|
94034
94045
|
capabilities: { tools: {} },
|
|
@@ -94036,21 +94047,21 @@ async function answerSupportLine({
|
|
|
94036
94047
|
}
|
|
94037
94048
|
});
|
|
94038
94049
|
}
|
|
94039
|
-
if (method === "ping") return rpc(
|
|
94040
|
-
if (method === "tools/list") return rpc(
|
|
94050
|
+
if (method === "ping") return rpc(id9, { result: {} });
|
|
94051
|
+
if (method === "tools/list") return rpc(id9, { result: { tools: SUPPORT_MCP_TOOLS } });
|
|
94041
94052
|
if (method !== "tools/call") {
|
|
94042
|
-
return rpc(
|
|
94053
|
+
return rpc(id9, { error: { code: METHOD_NOT_FOUND, message: `No method ${String(method)}` } });
|
|
94043
94054
|
}
|
|
94044
94055
|
const call = routeOf({ name: params.name, input: recordOf3(params.arguments) });
|
|
94045
|
-
if (!call) return rpc(
|
|
94056
|
+
if (!call) return rpc(id9, { error: { code: INVALID_PARAMS, message: "Unknown tool or input" } });
|
|
94046
94057
|
const scoped = client.withHeaders({ "x-laze-turn": turn });
|
|
94047
94058
|
try {
|
|
94048
94059
|
const answer6 = call.body === void 0 ? await scoped.get(call.path) : await scoped.post(call.path, call.body);
|
|
94049
|
-
return rpc(
|
|
94060
|
+
return rpc(id9, { result: { content: contentOf(answer6) } });
|
|
94050
94061
|
} catch (error63) {
|
|
94051
94062
|
if (!(error63 instanceof LazeApiError)) throw error63;
|
|
94052
94063
|
const text3 = `${error63.code}: ${error63.message}`;
|
|
94053
|
-
return rpc(
|
|
94064
|
+
return rpc(id9, { result: { content: [{ type: "text", text: text3 }], isError: true } });
|
|
94054
94065
|
}
|
|
94055
94066
|
}
|
|
94056
94067
|
function routeOf({
|
|
@@ -94083,8 +94094,8 @@ function contentOf(answer6) {
|
|
|
94083
94094
|
)
|
|
94084
94095
|
];
|
|
94085
94096
|
}
|
|
94086
|
-
function rpc(
|
|
94087
|
-
return JSON.stringify({ jsonrpc: "2.0", id:
|
|
94097
|
+
function rpc(id9, body) {
|
|
94098
|
+
return JSON.stringify({ jsonrpc: "2.0", id: id9, ...body });
|
|
94088
94099
|
}
|
|
94089
94100
|
|
|
94090
94101
|
// src/services/mcp-gateway.service.ts
|
|
@@ -94255,8 +94266,8 @@ async function recheckTools({ relay: relay2, listed }) {
|
|
|
94255
94266
|
listed.busy = true;
|
|
94256
94267
|
try {
|
|
94257
94268
|
listed.asked += 1;
|
|
94258
|
-
const
|
|
94259
|
-
const line = JSON.stringify({ jsonrpc: "2.0", id:
|
|
94269
|
+
const id9 = `laze-relist-${listed.asked}`;
|
|
94270
|
+
const line = JSON.stringify({ jsonrpc: "2.0", id: id9, method: "tools/list" });
|
|
94260
94271
|
const names = toolNamesOf(await relay2.post({ line, turn }));
|
|
94261
94272
|
listed.turn = turn;
|
|
94262
94273
|
if (names !== null && names !== listed.names) {
|
|
@@ -94506,15 +94517,15 @@ function printGrant({ context, grant }) {
|
|
|
94506
94517
|
var grantTo = async ({ context, args }) => {
|
|
94507
94518
|
const [kind2 = "", ...rest] = flagText({ args, name: "to" }).split(":");
|
|
94508
94519
|
const subject = SUBJECTS.find((one) => one === kind2);
|
|
94509
|
-
const
|
|
94510
|
-
if (!subject || !
|
|
94520
|
+
const id9 = rest.join(":");
|
|
94521
|
+
if (!subject || !id9) {
|
|
94511
94522
|
throw new CliUsageError("--to is person:<id>, group:<id>, channel:<id> or agent:<id>.");
|
|
94512
94523
|
}
|
|
94513
94524
|
const { client } = await signedIn({ context, args });
|
|
94514
94525
|
const target = await connectionOf({ client, args, word: args.words[2] });
|
|
94515
94526
|
const grant = await client.post("/api/vault/grants", {
|
|
94516
94527
|
connectionId: target.id,
|
|
94517
|
-
subject: { kind: subject, id:
|
|
94528
|
+
subject: { kind: subject, id: id9 },
|
|
94518
94529
|
...durationOf(args)
|
|
94519
94530
|
});
|
|
94520
94531
|
if (args.flags.json) return printJson4({ context, data: grant });
|
|
@@ -98237,8 +98248,8 @@ function draftFilesMissingText(names) {
|
|
|
98237
98248
|
}
|
|
98238
98249
|
|
|
98239
98250
|
// ../../modules/feed/contract/src/feed.decisions.ts
|
|
98240
|
-
function decisionsLineOf(
|
|
98241
|
-
return `${
|
|
98251
|
+
function decisionsLineOf(count16) {
|
|
98252
|
+
return `${count16} ${count16 === 1 ? "decision" : "decisions"} waiting on you`;
|
|
98242
98253
|
}
|
|
98243
98254
|
|
|
98244
98255
|
// src/rules/feed-input.rules.ts
|
|
@@ -98776,8 +98787,8 @@ function optionalWords(words) {
|
|
|
98776
98787
|
}
|
|
98777
98788
|
function shareLinesOf({ move: move3, answer: answer6 }) {
|
|
98778
98789
|
const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
|
|
98779
|
-
const
|
|
98780
|
-
const items = `${
|
|
98790
|
+
const count16 = answer6.itemIds.length;
|
|
98791
|
+
const items = `${count16} item${count16 === 1 ? "" : "s"}`;
|
|
98781
98792
|
const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
|
|
98782
98793
|
return [head, ...answer6.itemIds].map((line) => `${line}
|
|
98783
98794
|
`).join("");
|
|
@@ -99424,13 +99435,13 @@ function formatHistory(output2) {
|
|
|
99424
99435
|
const lines2 = linesOf3(output2);
|
|
99425
99436
|
if (lines2.length === 0) return `${where}${from}: no messages.
|
|
99426
99437
|
`;
|
|
99427
|
-
const
|
|
99438
|
+
const count16 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
|
|
99428
99439
|
const blocks = lines2.map(blockOf2).join("\n\n");
|
|
99429
99440
|
const cursor = olderCursorOf(output2);
|
|
99430
99441
|
const older = cursor ? `
|
|
99431
99442
|
|
|
99432
99443
|
Older: laze history ${output2.channel} --before ${cursor}` : "";
|
|
99433
|
-
return `${where}${from}: ${
|
|
99444
|
+
return `${where}${from}: ${count16}, oldest first
|
|
99434
99445
|
|
|
99435
99446
|
${blocks}${older}
|
|
99436
99447
|
`;
|
|
@@ -100064,7 +100075,7 @@ async function connect2({ context, args }) {
|
|
|
100064
100075
|
sensitivity: sensitivity2
|
|
100065
100076
|
});
|
|
100066
100077
|
const { connection, relayKey } = answer6;
|
|
100067
|
-
const rest = Object.fromEntries(Object.entries(relays).filter(([
|
|
100078
|
+
const rest = Object.fromEntries(Object.entries(relays).filter(([id9]) => id9 !== kept?.[0]));
|
|
100068
100079
|
await saveMcpRelays({
|
|
100069
100080
|
context,
|
|
100070
100081
|
relays: {
|
|
@@ -100779,10 +100790,10 @@ ${USAGE13}`);
|
|
|
100779
100790
|
if ("exitCode" in released) return released;
|
|
100780
100791
|
Object.assign(env, released.env);
|
|
100781
100792
|
}
|
|
100782
|
-
const
|
|
100783
|
-
if (
|
|
100793
|
+
const count16 = Object.keys(env).length;
|
|
100794
|
+
if (count16 > EXEC_ENV_MAX) {
|
|
100784
100795
|
context.err(
|
|
100785
|
-
`laze: these connections hold ${
|
|
100796
|
+
`laze: these connections hold ${count16} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
|
|
100786
100797
|
`
|
|
100787
100798
|
);
|
|
100788
100799
|
return { exitCode: 1 };
|
|
@@ -100927,8 +100938,8 @@ function recordOf4(value) {
|
|
|
100927
100938
|
function idsOf(message2) {
|
|
100928
100939
|
const messages = Array.isArray(message2) ? message2 : [message2];
|
|
100929
100940
|
return messages.flatMap((each) => {
|
|
100930
|
-
const
|
|
100931
|
-
return
|
|
100941
|
+
const id9 = recordOf4(each).id;
|
|
100942
|
+
return id9 === void 0 || id9 === null ? [] : [id9];
|
|
100932
100943
|
});
|
|
100933
100944
|
}
|
|
100934
100945
|
function toolResultOf({ text: text3, isError }) {
|
|
@@ -100939,7 +100950,7 @@ function secretRefusal({
|
|
|
100939
100950
|
rules = MCP_SECRET_COMMANDS
|
|
100940
100951
|
}) {
|
|
100941
100952
|
const { words, flags: flags2 } = parseArgs({ argv });
|
|
100942
|
-
const command = [3, 2, 1].map((
|
|
100953
|
+
const command = [3, 2, 1].map((count16) => words.slice(0, count16).join(" ")).find((name3) => Object.hasOwn(rules, name3));
|
|
100943
100954
|
const rule = command === void 0 ? void 0 : rules[command];
|
|
100944
100955
|
if (!command || !rule) return void 0;
|
|
100945
100956
|
const vaultFlag = rule.vaultFlag ?? "from-vault";
|
|
@@ -100992,9 +101003,9 @@ function refusedLines2({
|
|
|
100992
101003
|
const migrated = status11 === 401 ? migratedNoticeOf(apiErrorOf({ status: status11, text: text3 })) : void 0;
|
|
100993
101004
|
const refused = status11 === 401 ? "Laze refused this key: run `laze login` or link the agent again" : `Laze answered ${status11}`;
|
|
100994
101005
|
const reason2 = migrated?.notice ?? refused;
|
|
100995
|
-
const errors = idsOf(message2).map((
|
|
101006
|
+
const errors = idsOf(message2).map((id9) => ({
|
|
100996
101007
|
jsonrpc: "2.0",
|
|
100997
|
-
id:
|
|
101008
|
+
id: id9,
|
|
100998
101009
|
error: { code: SERVER_REFUSED, message: reason2 }
|
|
100999
101010
|
}));
|
|
101000
101011
|
if (errors.length === 0) return [];
|
|
@@ -101280,7 +101291,7 @@ function logTarget({
|
|
|
101280
101291
|
const layer = flagText({ args, name: "layer", fallback: "person" });
|
|
101281
101292
|
if (layer !== "person" && layer !== "agent") throw new CliUsageError(USAGE14);
|
|
101282
101293
|
const channel = turn ? flagText({ args, name: "channel" }) : turnChannel({ context, args });
|
|
101283
|
-
const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((
|
|
101294
|
+
const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id9) => id9.trim()).filter(Boolean);
|
|
101284
101295
|
const message2 = flagText({ args, name: "message" }) || messages.at(-1) || "";
|
|
101285
101296
|
const person = flagText({ args, name: "person" });
|
|
101286
101297
|
return {
|
|
@@ -101336,9 +101347,9 @@ async function logCall({
|
|
|
101336
101347
|
printAnswer2({ context, args, answer: answer6 });
|
|
101337
101348
|
}
|
|
101338
101349
|
function entryId(args) {
|
|
101339
|
-
const
|
|
101340
|
-
if (!Number.isInteger(
|
|
101341
|
-
return
|
|
101350
|
+
const id9 = Number((args.words[2] ?? "").replace(/^#/, ""));
|
|
101351
|
+
if (!Number.isInteger(id9) || id9 < 0) throw new CliUsageError(USAGE14);
|
|
101352
|
+
return id9;
|
|
101342
101353
|
}
|
|
101343
101354
|
function blockArg(args) {
|
|
101344
101355
|
const block2 = (args.words[2] ?? "").replace(/^#/, "");
|
|
@@ -101350,9 +101361,9 @@ async function memoryNote({ context, args }) {
|
|
|
101350
101361
|
await logCall({ context, args, path: "note", body: line });
|
|
101351
101362
|
}
|
|
101352
101363
|
async function memoryCorrect({ context, args }) {
|
|
101353
|
-
const
|
|
101364
|
+
const id9 = entryId(args);
|
|
101354
101365
|
const line = await taggedLine({ context, args, from: 3 });
|
|
101355
|
-
await logCall({ context, args, path: "correct", body: { id:
|
|
101366
|
+
await logCall({ context, args, path: "correct", body: { id: id9, ...line } });
|
|
101356
101367
|
}
|
|
101357
101368
|
async function memoryRemove({ context, args }) {
|
|
101358
101369
|
await logCall({ context, args, path: "remove", body: { id: entryId(args) } });
|
|
@@ -101690,11 +101701,11 @@ async function monitorAdd({ context, args }) {
|
|
|
101690
101701
|
});
|
|
101691
101702
|
if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
|
|
101692
101703
|
`);
|
|
101693
|
-
const
|
|
101704
|
+
const count16 = added.watching.length;
|
|
101694
101705
|
context.out(
|
|
101695
101706
|
`${added.monitor.id} ${added.monitor.name}
|
|
101696
101707
|
${added.watching.join(" ")}
|
|
101697
|
-
Watching ${
|
|
101708
|
+
Watching ${count16} ${count16 === 1 ? "channel" : "channels"}
|
|
101698
101709
|
`
|
|
101699
101710
|
);
|
|
101700
101711
|
}
|
|
@@ -101924,7 +101935,7 @@ var connectLocal = async ({ context, args, client, url: url2 }) => {
|
|
|
101924
101935
|
...label3 && { label: label3 }
|
|
101925
101936
|
});
|
|
101926
101937
|
const { connection, relayKey } = answer6;
|
|
101927
|
-
const rest = Object.fromEntries(Object.entries(relays).filter(([
|
|
101938
|
+
const rest = Object.fromEntries(Object.entries(relays).filter(([id9]) => id9 !== kept?.[0]));
|
|
101928
101939
|
await saveRelays({
|
|
101929
101940
|
context,
|
|
101930
101941
|
relays: { ...rest, [connection.id]: { url: url2, relayKey, gatewayUrl: gatewayUrl2, label: connection.label } }
|
|
@@ -102947,8 +102958,8 @@ var RumApi = moduleApi()("rum");
|
|
|
102947
102958
|
|
|
102948
102959
|
// ../../packages/secrets/src/secret.ts
|
|
102949
102960
|
var SecretHandle = class {
|
|
102950
|
-
constructor(
|
|
102951
|
-
this.id =
|
|
102961
|
+
constructor(id9, optional2, schema) {
|
|
102962
|
+
this.id = id9;
|
|
102952
102963
|
this.optional = optional2;
|
|
102953
102964
|
this.schema = schema;
|
|
102954
102965
|
}
|
|
@@ -102962,8 +102973,8 @@ var SecretFamilyHandle = class extends SecretHandle {
|
|
|
102962
102973
|
super(prefix2, true, void 0);
|
|
102963
102974
|
}
|
|
102964
102975
|
};
|
|
102965
|
-
function load(
|
|
102966
|
-
return new SecretHandle(
|
|
102976
|
+
function load(id9, options) {
|
|
102977
|
+
return new SecretHandle(id9, options?.optional === true, options?.schema);
|
|
102967
102978
|
}
|
|
102968
102979
|
function family(prefix2) {
|
|
102969
102980
|
return new SecretFamilyHandle(prefix2);
|
|
@@ -103023,6 +103034,469 @@ var rumBrowserConfigDefinition = external_exports.strictObject({
|
|
|
103023
103034
|
sampleRatio: external_exports.number().min(0).max(1)
|
|
103024
103035
|
});
|
|
103025
103036
|
|
|
103037
|
+
// ../../modules/wiki/contract/src/wiki-comments.ts
|
|
103038
|
+
var COMMENT_MAX = 4e3;
|
|
103039
|
+
var QUOTE_MAX = 1e3;
|
|
103040
|
+
var wikiCommentAuthorSchema = external_exports.object({
|
|
103041
|
+
kind: external_exports.enum(["person", "agent"]),
|
|
103042
|
+
id: external_exports.string(),
|
|
103043
|
+
name: external_exports.string()
|
|
103044
|
+
});
|
|
103045
|
+
var wikiCommentSchema = external_exports.object({
|
|
103046
|
+
id: external_exports.string(),
|
|
103047
|
+
author: wikiCommentAuthorSchema,
|
|
103048
|
+
body: external_exports.string(),
|
|
103049
|
+
createdAt: external_exports.iso.datetime()
|
|
103050
|
+
});
|
|
103051
|
+
var wikiThreadSchemaDefinition = external_exports.object({
|
|
103052
|
+
id: external_exports.string(),
|
|
103053
|
+
/** The text the thread is about, as it was selected. */
|
|
103054
|
+
quote: external_exports.string(),
|
|
103055
|
+
/** The quote is no longer in the page's body. */
|
|
103056
|
+
detached: external_exports.boolean(),
|
|
103057
|
+
resolved: external_exports.object({ by: wikiCommentAuthorSchema, at: external_exports.iso.datetime() }).nullable(),
|
|
103058
|
+
/** The first comment, then the replies, oldest first. */
|
|
103059
|
+
comments: external_exports.array(wikiCommentSchema)
|
|
103060
|
+
});
|
|
103061
|
+
var wikiThreadSchema = wikiThreadSchemaDefinition;
|
|
103062
|
+
var wikiThreadsSchemaDefinition = external_exports.object({
|
|
103063
|
+
path: external_exports.string(),
|
|
103064
|
+
/** Open threads on the page, whatever the listing holds. */
|
|
103065
|
+
open: external_exports.number().int().nonnegative(),
|
|
103066
|
+
threads: external_exports.array(wikiThreadSchemaDefinition)
|
|
103067
|
+
});
|
|
103068
|
+
var wikiThreadsSchema = wikiThreadsSchemaDefinition;
|
|
103069
|
+
var wikiCommentPostedSchemaDefinition = external_exports.object({
|
|
103070
|
+
thread: wikiThreadSchemaDefinition,
|
|
103071
|
+
/** People mentioned who were not told, because they cannot read the page. */
|
|
103072
|
+
notTold: external_exports.array(external_exports.string())
|
|
103073
|
+
});
|
|
103074
|
+
var wikiCommentPostedSchema = wikiCommentPostedSchemaDefinition;
|
|
103075
|
+
var pathSchema = external_exports.string().min(1).max(200);
|
|
103076
|
+
var bodySchema2 = external_exports.string().trim().min(1).max(COMMENT_MAX);
|
|
103077
|
+
var wikiThreadsInputSchemaDefinition = external_exports.object({
|
|
103078
|
+
path: pathSchema,
|
|
103079
|
+
/** Only the threads not resolved. */
|
|
103080
|
+
open: external_exports.boolean().optional()
|
|
103081
|
+
});
|
|
103082
|
+
var wikiCommentInputSchemaDefinition = external_exports.object({
|
|
103083
|
+
path: pathSchema,
|
|
103084
|
+
quote: external_exports.string().trim().min(1).max(QUOTE_MAX),
|
|
103085
|
+
body: bodySchema2
|
|
103086
|
+
});
|
|
103087
|
+
var wikiReplyInputSchemaDefinition = external_exports.object({ threadId: external_exports.string().min(1), body: bodySchema2 });
|
|
103088
|
+
var wikiResolveInputSchemaDefinition = external_exports.object({
|
|
103089
|
+
threadId: external_exports.string().min(1),
|
|
103090
|
+
/** False reopens it. */
|
|
103091
|
+
resolved: external_exports.boolean().default(true)
|
|
103092
|
+
});
|
|
103093
|
+
var wikiCommentRefSchemaDefinition = external_exports.object({ commentId: external_exports.string().min(1) });
|
|
103094
|
+
var workspaced = { workspaceId: external_exports.string().min(1) };
|
|
103095
|
+
var wikiThreadsInWorkspaceSchemaDefinition = external_exports.object({
|
|
103096
|
+
...wikiThreadsInputSchemaDefinition.shape,
|
|
103097
|
+
...workspaced
|
|
103098
|
+
});
|
|
103099
|
+
var wikiThreadsInWorkspaceSchema = wikiThreadsInWorkspaceSchemaDefinition;
|
|
103100
|
+
var wikiCommentInWorkspaceSchemaDefinition = external_exports.object({
|
|
103101
|
+
...wikiCommentInputSchemaDefinition.shape,
|
|
103102
|
+
...workspaced
|
|
103103
|
+
});
|
|
103104
|
+
var wikiCommentInWorkspaceSchema = wikiCommentInWorkspaceSchemaDefinition;
|
|
103105
|
+
var wikiReplyInWorkspaceSchemaDefinition = external_exports.object({
|
|
103106
|
+
...wikiReplyInputSchemaDefinition.shape,
|
|
103107
|
+
...workspaced
|
|
103108
|
+
});
|
|
103109
|
+
var wikiReplyInWorkspaceSchema = wikiReplyInWorkspaceSchemaDefinition;
|
|
103110
|
+
var wikiResolveInWorkspaceSchemaDefinition = external_exports.object({
|
|
103111
|
+
...wikiResolveInputSchemaDefinition.shape,
|
|
103112
|
+
...workspaced
|
|
103113
|
+
});
|
|
103114
|
+
var wikiResolveInWorkspaceSchema = wikiResolveInWorkspaceSchemaDefinition;
|
|
103115
|
+
var wikiCommentRefInWorkspaceSchemaDefinition = external_exports.object({
|
|
103116
|
+
...wikiCommentRefSchemaDefinition.shape,
|
|
103117
|
+
...workspaced
|
|
103118
|
+
});
|
|
103119
|
+
var wikiCommentRefInWorkspaceSchema = wikiCommentRefInWorkspaceSchemaDefinition;
|
|
103120
|
+
var wikiMentionViewSchemaDefinition = external_exports.discriminatedUnion("found", [
|
|
103121
|
+
external_exports.object({
|
|
103122
|
+
commentId: external_exports.string(),
|
|
103123
|
+
found: external_exports.literal(true),
|
|
103124
|
+
authorName: external_exports.string(),
|
|
103125
|
+
pageTitle: external_exports.string(),
|
|
103126
|
+
body: external_exports.string(),
|
|
103127
|
+
/** The page's address, opened on the thread. */
|
|
103128
|
+
path: external_exports.string()
|
|
103129
|
+
}),
|
|
103130
|
+
external_exports.object({ commentId: external_exports.string(), found: external_exports.literal(false) })
|
|
103131
|
+
]);
|
|
103132
|
+
|
|
103133
|
+
// ../../modules/wiki/contract/src/wiki-files.ts
|
|
103134
|
+
var WIKI_FILE_MAX_BYTES = 25 * 1024 * 1024;
|
|
103135
|
+
var wikiFileSchemaDefinition = external_exports.object({
|
|
103136
|
+
id: external_exports.string(),
|
|
103137
|
+
name: external_exports.string(),
|
|
103138
|
+
contentType: external_exports.string(),
|
|
103139
|
+
sizeBytes: external_exports.number().int().nonnegative(),
|
|
103140
|
+
/** The address bodies embed; it asks the wiki whether the reader may read the page. */
|
|
103141
|
+
url: external_exports.string(),
|
|
103142
|
+
ready: external_exports.boolean()
|
|
103143
|
+
});
|
|
103144
|
+
var wikiFileSchema = wikiFileSchemaDefinition;
|
|
103145
|
+
var wikiFilesSchemaDefinition = external_exports.object({
|
|
103146
|
+
path: external_exports.string(),
|
|
103147
|
+
files: external_exports.array(wikiFileSchemaDefinition)
|
|
103148
|
+
});
|
|
103149
|
+
var wikiFilesSchema = wikiFilesSchemaDefinition;
|
|
103150
|
+
var wikiAttachTicketSchemaDefinition = external_exports.object({
|
|
103151
|
+
file: wikiFileSchemaDefinition,
|
|
103152
|
+
/** Where to send the bytes, then call attachDone with each part's tag. */
|
|
103153
|
+
upload: uploadTicketSchema2
|
|
103154
|
+
});
|
|
103155
|
+
var wikiAttachTicketSchema = wikiAttachTicketSchemaDefinition;
|
|
103156
|
+
var wikiFileLinkSchemaDefinition = external_exports.object({ url: external_exports.string(), expiresAt: external_exports.string() });
|
|
103157
|
+
var pathSchema2 = external_exports.string().min(1).max(200);
|
|
103158
|
+
var wikiAttachInputSchemaDefinition = external_exports.object({
|
|
103159
|
+
path: pathSchema2,
|
|
103160
|
+
fileName: external_exports.string().trim().min(1).max(255),
|
|
103161
|
+
contentType: external_exports.string().trim().min(1).max(200),
|
|
103162
|
+
sizeBytes: external_exports.number().int().positive()
|
|
103163
|
+
});
|
|
103164
|
+
var wikiAttachDoneInputSchemaDefinition = external_exports.object({
|
|
103165
|
+
path: pathSchema2,
|
|
103166
|
+
fileId: external_exports.string().min(1).max(200),
|
|
103167
|
+
parts: external_exports.array(finishedPartSchema).max(1e4)
|
|
103168
|
+
});
|
|
103169
|
+
var wikiFileRefSchemaDefinition = external_exports.object({
|
|
103170
|
+
workspaceId: external_exports.string().min(1).max(200),
|
|
103171
|
+
fileId: external_exports.string().min(1).max(200)
|
|
103172
|
+
});
|
|
103173
|
+
var wikiFileRefSchema = wikiFileRefSchemaDefinition;
|
|
103174
|
+
var wikiPublicFileRefSchemaDefinition = external_exports.object({
|
|
103175
|
+
token: external_exports.string().min(1).max(200),
|
|
103176
|
+
fileId: external_exports.string().min(1).max(200)
|
|
103177
|
+
});
|
|
103178
|
+
var workspaced2 = { workspaceId: external_exports.string().min(1) };
|
|
103179
|
+
var wikiAttachInWorkspaceSchemaDefinition = external_exports.object({
|
|
103180
|
+
...wikiAttachInputSchemaDefinition.shape,
|
|
103181
|
+
...workspaced2
|
|
103182
|
+
});
|
|
103183
|
+
var wikiAttachInWorkspaceSchema = wikiAttachInWorkspaceSchemaDefinition;
|
|
103184
|
+
var wikiAttachDoneInWorkspaceSchemaDefinition = external_exports.object({
|
|
103185
|
+
...wikiAttachDoneInputSchemaDefinition.shape,
|
|
103186
|
+
...workspaced2
|
|
103187
|
+
});
|
|
103188
|
+
var wikiAttachDoneInWorkspaceSchema = wikiAttachDoneInWorkspaceSchemaDefinition;
|
|
103189
|
+
|
|
103190
|
+
// ../../modules/wiki/contract/src/wiki-frontmatter.ts
|
|
103191
|
+
var wikiFieldValueSchema = external_exports.json();
|
|
103192
|
+
|
|
103193
|
+
// ../../modules/wiki/contract/src/wiki-roles.ts
|
|
103194
|
+
var WIKI_VISIBILITIES = ["restricted", "channel", "internal", "public"];
|
|
103195
|
+
var wikiVisibilitySchema = external_exports.enum(WIKI_VISIBILITIES);
|
|
103196
|
+
var WIKI_ROLES = ["view", "edit"];
|
|
103197
|
+
var wikiRoleSchema = external_exports.enum(WIKI_ROLES);
|
|
103198
|
+
|
|
103199
|
+
// ../../modules/wiki/contract/src/wiki-pins.ts
|
|
103200
|
+
var wikiPinInputSchemaDefinition = external_exports.object({
|
|
103201
|
+
workspaceId: external_exports.string().min(1),
|
|
103202
|
+
path: external_exports.string().min(1).max(200),
|
|
103203
|
+
channelId: external_exports.string().min(1),
|
|
103204
|
+
/** What the conversation's members may do: edit by default, or view. */
|
|
103205
|
+
role: wikiRoleSchema.default("edit")
|
|
103206
|
+
});
|
|
103207
|
+
var wikiPinInputSchema = wikiPinInputSchemaDefinition;
|
|
103208
|
+
var wikiUnpinInputSchemaDefinition = external_exports.object({
|
|
103209
|
+
workspaceId: external_exports.string().min(1),
|
|
103210
|
+
path: external_exports.string().min(1).max(200),
|
|
103211
|
+
channelId: external_exports.string().min(1)
|
|
103212
|
+
});
|
|
103213
|
+
var wikiUnpinInputSchema = wikiUnpinInputSchemaDefinition;
|
|
103214
|
+
var wikiPinsInputSchemaDefinition = external_exports.object({
|
|
103215
|
+
workspaceId: external_exports.string().min(1),
|
|
103216
|
+
channelId: external_exports.string().min(1)
|
|
103217
|
+
});
|
|
103218
|
+
var wikiPinsInputSchema = wikiPinsInputSchemaDefinition;
|
|
103219
|
+
var wikiPinByKeyInputSchemaDefinition = external_exports.object({
|
|
103220
|
+
path: external_exports.string().min(1).max(200),
|
|
103221
|
+
channel: external_exports.string().trim().min(1).max(200),
|
|
103222
|
+
role: wikiRoleSchema.default("edit")
|
|
103223
|
+
});
|
|
103224
|
+
var wikiPinTabSchemaDefinition = external_exports.object({
|
|
103225
|
+
path: external_exports.string(),
|
|
103226
|
+
/** The page's title, or the folder's last segment. */
|
|
103227
|
+
title: external_exports.string(),
|
|
103228
|
+
folder: external_exports.boolean(),
|
|
103229
|
+
role: wikiRoleSchema,
|
|
103230
|
+
pinnedBy: external_exports.string().nullable(),
|
|
103231
|
+
pinnedAt: external_exports.string().nullable()
|
|
103232
|
+
});
|
|
103233
|
+
var wikiChannelPinsSchemaDefinition = external_exports.object({
|
|
103234
|
+
channelId: external_exports.string(),
|
|
103235
|
+
pins: external_exports.array(wikiPinTabSchemaDefinition)
|
|
103236
|
+
});
|
|
103237
|
+
var wikiChannelPinsSchema = wikiChannelPinsSchemaDefinition;
|
|
103238
|
+
var WikiPinStripSlot = uiTokens("wiki").component("pinStrip");
|
|
103239
|
+
var WikiPanelSlot = uiTokens("wiki").component("panel");
|
|
103240
|
+
|
|
103241
|
+
// ../../modules/wiki/contract/src/wiki.ts
|
|
103242
|
+
var WIKI_BODY_MAX_CHARS = 1e6;
|
|
103243
|
+
var wikiAuthorSchemaDefinition = external_exports.object({
|
|
103244
|
+
kind: external_exports.enum(["person", "agent"]),
|
|
103245
|
+
id: external_exports.string(),
|
|
103246
|
+
name: external_exports.string()
|
|
103247
|
+
});
|
|
103248
|
+
var wikiPageAccessSchemaDefinition = external_exports.object({
|
|
103249
|
+
visibility: wikiVisibilitySchema,
|
|
103250
|
+
role: wikiRoleSchema
|
|
103251
|
+
});
|
|
103252
|
+
var wikiPageLinkSchemaDefinition = external_exports.object({ path: external_exports.string(), title: external_exports.string() });
|
|
103253
|
+
var wikiPageSchemaDefinition = external_exports.object({
|
|
103254
|
+
id: external_exports.string(),
|
|
103255
|
+
workspaceId: external_exports.string(),
|
|
103256
|
+
/** Nested by `/`: `ops/oncall/rota`. */
|
|
103257
|
+
path: external_exports.string(),
|
|
103258
|
+
title: external_exports.string(),
|
|
103259
|
+
body: external_exports.string(),
|
|
103260
|
+
/** Set when only that channel's members see the page. */
|
|
103261
|
+
channelId: external_exports.string().nullable(),
|
|
103262
|
+
version: external_exports.number().int().positive(),
|
|
103263
|
+
/** The paths this page links to with `[[path]]`. */
|
|
103264
|
+
links: external_exports.array(external_exports.string()),
|
|
103265
|
+
/** The pages the reader can see that link here. */
|
|
103266
|
+
backlinks: external_exports.array(wikiPageLinkSchemaDefinition),
|
|
103267
|
+
updatedBy: wikiAuthorSchemaDefinition,
|
|
103268
|
+
createdAt: external_exports.iso.datetime(),
|
|
103269
|
+
updatedAt: external_exports.iso.datetime(),
|
|
103270
|
+
/** The page's web address, on the answers a key reads. */
|
|
103271
|
+
url: lazeUrlSchema.optional(),
|
|
103272
|
+
/** Who sees it and what the reader may do. */
|
|
103273
|
+
sharing: wikiPageAccessSchemaDefinition.optional(),
|
|
103274
|
+
/** `type` in its YAML header (wiki-page-fields ADR). */
|
|
103275
|
+
type: external_exports.string().nullable().optional(),
|
|
103276
|
+
/** Every other key of its YAML header, as written. */
|
|
103277
|
+
fields: external_exports.record(external_exports.string(), wikiFieldValueSchema).optional(),
|
|
103278
|
+
/** Why the YAML header does not read, with its line; the body is kept as written. */
|
|
103279
|
+
headerProblem: external_exports.string().nullable().optional()
|
|
103280
|
+
});
|
|
103281
|
+
var wikiPageSchema = wikiPageSchemaDefinition;
|
|
103282
|
+
var wikiPageSummarySchemaDefinition = external_exports.object({
|
|
103283
|
+
path: external_exports.string(),
|
|
103284
|
+
title: external_exports.string(),
|
|
103285
|
+
channelId: external_exports.string().nullable(),
|
|
103286
|
+
updatedAt: external_exports.iso.datetime(),
|
|
103287
|
+
/** The page's web address, on the answers a key reads. */
|
|
103288
|
+
url: lazeUrlSchema.optional(),
|
|
103289
|
+
/** Who sees it and what the reader may do. */
|
|
103290
|
+
sharing: wikiPageAccessSchemaDefinition.optional(),
|
|
103291
|
+
/** `type` in its YAML header. */
|
|
103292
|
+
type: external_exports.string().nullable().optional()
|
|
103293
|
+
});
|
|
103294
|
+
var wikiTreeNodeSchemaDefinition = external_exports.lazy(
|
|
103295
|
+
() => external_exports.object({
|
|
103296
|
+
path: external_exports.string(),
|
|
103297
|
+
name: external_exports.string(),
|
|
103298
|
+
title: external_exports.string().nullable(),
|
|
103299
|
+
children: external_exports.array(wikiTreeNodeSchemaDefinition)
|
|
103300
|
+
})
|
|
103301
|
+
);
|
|
103302
|
+
var wikiListingSchemaDefinition = external_exports.object({
|
|
103303
|
+
pages: external_exports.array(wikiPageSummarySchemaDefinition),
|
|
103304
|
+
tree: external_exports.array(wikiTreeNodeSchemaDefinition)
|
|
103305
|
+
});
|
|
103306
|
+
var wikiListingSchema = wikiListingSchemaDefinition;
|
|
103307
|
+
var wikiWritableInputSchemaDefinition = external_exports.object({
|
|
103308
|
+
workspaceId: external_exports.string().min(1),
|
|
103309
|
+
paths: external_exports.array(external_exports.string().trim().max(200)).min(1).max(10)
|
|
103310
|
+
});
|
|
103311
|
+
var wikiWritableInputSchema = wikiWritableInputSchemaDefinition;
|
|
103312
|
+
var wikiWritablePlaceSchemaDefinition = external_exports.object({
|
|
103313
|
+
path: external_exports.string(),
|
|
103314
|
+
noChannel: external_exports.boolean(),
|
|
103315
|
+
channelIds: external_exports.array(external_exports.string())
|
|
103316
|
+
});
|
|
103317
|
+
var wikiWritablePlaceSchema = wikiWritablePlaceSchemaDefinition;
|
|
103318
|
+
var wikiHitSchemaDefinition = external_exports.object({
|
|
103319
|
+
path: external_exports.string(),
|
|
103320
|
+
title: external_exports.string(),
|
|
103321
|
+
/** A few words around the match. */
|
|
103322
|
+
snippet: external_exports.string(),
|
|
103323
|
+
rank: external_exports.number(),
|
|
103324
|
+
/** The page's web address. */
|
|
103325
|
+
url: lazeUrlSchema.optional()
|
|
103326
|
+
});
|
|
103327
|
+
var wikiHitSchema = wikiHitSchemaDefinition;
|
|
103328
|
+
var wikiRevisionSchemaDefinition = external_exports.object({
|
|
103329
|
+
version: external_exports.number().int().positive(),
|
|
103330
|
+
title: external_exports.string(),
|
|
103331
|
+
body: external_exports.string(),
|
|
103332
|
+
by: wikiAuthorSchemaDefinition,
|
|
103333
|
+
createdAt: external_exports.iso.datetime()
|
|
103334
|
+
});
|
|
103335
|
+
var wikiRevisionSchema = wikiRevisionSchemaDefinition;
|
|
103336
|
+
var wikiPathRefSchemaDefinition = external_exports.object({
|
|
103337
|
+
workspaceId: external_exports.string().min(1),
|
|
103338
|
+
path: external_exports.string().min(1).max(200)
|
|
103339
|
+
});
|
|
103340
|
+
var wikiPathRefSchema = wikiPathRefSchemaDefinition;
|
|
103341
|
+
var putFields = {
|
|
103342
|
+
path: external_exports.string().min(1).max(200),
|
|
103343
|
+
/** Defaults to the last path segment, as words. */
|
|
103344
|
+
title: external_exports.string().trim().max(200).optional(),
|
|
103345
|
+
body: external_exports.string().max(WIKI_BODY_MAX_CHARS, { error: "A page takes up to 1,000,000 characters" }),
|
|
103346
|
+
/** The version the editor opened; 0 for a new page. Left out, it saves over the newest. */
|
|
103347
|
+
baseVersion: external_exports.number().int().nonnegative().optional()
|
|
103348
|
+
};
|
|
103349
|
+
var putWikiPageInputSchemaDefinition = external_exports.object({
|
|
103350
|
+
...putFields,
|
|
103351
|
+
workspaceId: external_exports.string().min(1),
|
|
103352
|
+
/** Only for a new page: the channel whose members alone see it. */
|
|
103353
|
+
channelId: external_exports.string().min(1).nullable().optional()
|
|
103354
|
+
});
|
|
103355
|
+
var putWikiPageInputSchema = putWikiPageInputSchemaDefinition;
|
|
103356
|
+
var wikiPutByKeyInputSchemaDefinition = external_exports.object({
|
|
103357
|
+
...putFields,
|
|
103358
|
+
/** A channel the key's agent is in, by id or name. */
|
|
103359
|
+
channel: external_exports.string().trim().min(1).max(81).optional()
|
|
103360
|
+
});
|
|
103361
|
+
var moveWikiPageInputSchemaDefinition = external_exports.object({
|
|
103362
|
+
workspaceId: external_exports.string().min(1),
|
|
103363
|
+
path: external_exports.string().min(1).max(200),
|
|
103364
|
+
/** The new path; pages under the old one move with it. */
|
|
103365
|
+
to: external_exports.string().min(1).max(200)
|
|
103366
|
+
});
|
|
103367
|
+
var moveWikiPageInputSchema = moveWikiPageInputSchemaDefinition;
|
|
103368
|
+
var wikiMoveByKeyInputSchemaDefinition = external_exports.object({
|
|
103369
|
+
path: external_exports.string().min(1).max(200),
|
|
103370
|
+
to: external_exports.string().min(1).max(200)
|
|
103371
|
+
});
|
|
103372
|
+
var wikiQuerySchemaDefinition = external_exports.object({ query: external_exports.string().trim().min(1).max(200) });
|
|
103373
|
+
var wikiPathSchemaDefinition = external_exports.object({ path: external_exports.string().min(1).max(200) });
|
|
103374
|
+
var wikiGrantSubjectSchemaDefinition = external_exports.object({
|
|
103375
|
+
type: external_exports.enum(["user", "agent", "channel", "group"]),
|
|
103376
|
+
id: external_exports.string().min(1).max(100)
|
|
103377
|
+
});
|
|
103378
|
+
var wikiShareGrantSchemaDefinition = external_exports.object({
|
|
103379
|
+
subject: wikiGrantSubjectSchemaDefinition,
|
|
103380
|
+
role: wikiRoleSchema,
|
|
103381
|
+
/** As the dialog shows it ("Ada", "@people", "#ops"); null for a channel the reader is not in. */
|
|
103382
|
+
name: external_exports.string().nullable(),
|
|
103383
|
+
/** A channel share made by pinning: the page shows as a tab of that conversation. */
|
|
103384
|
+
pinned: external_exports.boolean().optional()
|
|
103385
|
+
});
|
|
103386
|
+
var wikiSharingSchemaDefinition = external_exports.object({
|
|
103387
|
+
path: external_exports.string(),
|
|
103388
|
+
/** `own`: set on this path; `inherited`: from the folder `from`; `default`: never set. */
|
|
103389
|
+
source: external_exports.enum(["own", "inherited", "default"]),
|
|
103390
|
+
/** The folder the sharing comes from, when inherited. */
|
|
103391
|
+
from: external_exports.string().nullable(),
|
|
103392
|
+
visibility: wikiVisibilitySchema,
|
|
103393
|
+
/** What General access lets people do. */
|
|
103394
|
+
memberRole: wikiRoleSchema,
|
|
103395
|
+
/** The channel `channel` visibility names; its name is null outside the reader's channels. */
|
|
103396
|
+
channel: external_exports.object({ id: external_exports.string(), name: external_exports.string().nullable() }).nullable(),
|
|
103397
|
+
grants: external_exports.array(wikiShareGrantSchemaDefinition),
|
|
103398
|
+
/** What the reader may do here. */
|
|
103399
|
+
role: wikiRoleSchema,
|
|
103400
|
+
/** The public link's token, while the sharing is public. */
|
|
103401
|
+
publicToken: external_exports.string().nullable(),
|
|
103402
|
+
/** Pages under this path that keep their own sharing. */
|
|
103403
|
+
ownBelow: external_exports.number().int().nonnegative(),
|
|
103404
|
+
/** The address of the public link, on the answers a key reads. */
|
|
103405
|
+
publicUrl: lazeUrlSchema.optional()
|
|
103406
|
+
});
|
|
103407
|
+
var wikiSharingSchema = wikiSharingSchemaDefinition;
|
|
103408
|
+
var sharingFields = {
|
|
103409
|
+
visibility: wikiVisibilitySchema.optional(),
|
|
103410
|
+
memberRole: wikiRoleSchema.optional()
|
|
103411
|
+
};
|
|
103412
|
+
var setWikiSharingInputSchemaDefinition = external_exports.object({
|
|
103413
|
+
workspaceId: external_exports.string().min(1),
|
|
103414
|
+
path: external_exports.string().min(1).max(200),
|
|
103415
|
+
...sharingFields,
|
|
103416
|
+
/** For `channel`: a channel the setter is in; left out, the page's own channel. */
|
|
103417
|
+
channelId: external_exports.string().min(1).nullable().optional()
|
|
103418
|
+
});
|
|
103419
|
+
var setWikiSharingInputSchema = setWikiSharingInputSchemaDefinition;
|
|
103420
|
+
var wikiGrantInputSchemaDefinition = external_exports.object({
|
|
103421
|
+
workspaceId: external_exports.string().min(1),
|
|
103422
|
+
path: external_exports.string().min(1).max(200),
|
|
103423
|
+
subject: wikiGrantSubjectSchemaDefinition,
|
|
103424
|
+
role: wikiRoleSchema
|
|
103425
|
+
});
|
|
103426
|
+
var wikiGrantInputSchema = wikiGrantInputSchemaDefinition;
|
|
103427
|
+
var wikiRevokeInputSchemaDefinition = external_exports.object({
|
|
103428
|
+
workspaceId: external_exports.string().min(1),
|
|
103429
|
+
path: external_exports.string().min(1).max(200),
|
|
103430
|
+
subject: wikiGrantSubjectSchemaDefinition
|
|
103431
|
+
});
|
|
103432
|
+
var wikiRevokeInputSchema = wikiRevokeInputSchemaDefinition;
|
|
103433
|
+
var wikiSetSharingByKeyInputSchemaDefinition = external_exports.object({
|
|
103434
|
+
path: external_exports.string().min(1).max(200),
|
|
103435
|
+
...sharingFields,
|
|
103436
|
+
/** A channel the key's agent or person is in, by id or name. */
|
|
103437
|
+
channel: external_exports.string().trim().min(1).max(81).optional()
|
|
103438
|
+
});
|
|
103439
|
+
var wikiGrantByKeyInputSchemaDefinition = external_exports.object({
|
|
103440
|
+
path: external_exports.string().min(1).max(200),
|
|
103441
|
+
who: external_exports.string().trim().min(1).max(200),
|
|
103442
|
+
role: wikiRoleSchema.default("view")
|
|
103443
|
+
});
|
|
103444
|
+
var wikiRevokeByKeyInputSchemaDefinition = external_exports.object({
|
|
103445
|
+
path: external_exports.string().min(1).max(200),
|
|
103446
|
+
who: external_exports.string().trim().min(1).max(200)
|
|
103447
|
+
});
|
|
103448
|
+
var wikiPublicRefSchemaDefinition = external_exports.object({
|
|
103449
|
+
token: external_exports.string().min(20).max(100),
|
|
103450
|
+
path: external_exports.string().max(200).optional()
|
|
103451
|
+
});
|
|
103452
|
+
var wikiPublicRefSchema = wikiPublicRefSchemaDefinition;
|
|
103453
|
+
var wikiPublicPageSchemaDefinition = external_exports.object({ title: external_exports.string(), body: external_exports.string() });
|
|
103454
|
+
var wikiPublicPageSchema = wikiPublicPageSchemaDefinition;
|
|
103455
|
+
var WikiApi = moduleApi()("wiki");
|
|
103456
|
+
var WIKI_LIST_PATH = "wiki.list";
|
|
103457
|
+
var WIKI_GET_PATH = "wiki.get";
|
|
103458
|
+
var paintCopyOf = (path) => ({
|
|
103459
|
+
path,
|
|
103460
|
+
paintOnly: true,
|
|
103461
|
+
storable: (copy2) => VAULT_NAMED_TEXT.test(JSON.stringify(copy2)) ? void 0 : copy2
|
|
103462
|
+
});
|
|
103463
|
+
var wikiListCopy = paintCopyOf(WIKI_LIST_PATH);
|
|
103464
|
+
var wikiPageCopy = paintCopyOf(WIKI_GET_PATH);
|
|
103465
|
+
var wikiTrpc = defineTrpcContract("wiki").query("list", { mirrored: wikiListCopy }).withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(wikiListingSchema).query("get", { mirrored: wikiPageCopy }).withInput(wikiPathRefSchema).withOutput(wikiPageSchema).query("history").withInput(wikiPathRefSchema).withOutput(external_exports.array(wikiRevisionSchema)).query("writable").withInput(wikiWritableInputSchema).withOutput(external_exports.array(wikiWritablePlaceSchema)).query("search").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), query: external_exports.string().trim().min(1).max(200) })).withOutput(external_exports.array(wikiHitSchema)).mutation("put").withInput(putWikiPageInputSchema).withOutput(wikiPageSchema).mutation("move").withInput(moveWikiPageInputSchema).withOutput(wikiPageSchema).mutation("remove").withInput(wikiPathRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).query("sharing").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("setSharing").withInput(setWikiSharingInputSchema).withOutput(wikiSharingSchema).mutation("resetSharing").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("takeBack").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("grant").withInput(wikiGrantInputSchema).withOutput(wikiSharingSchema).mutation("revoke").withInput(wikiRevokeInputSchema).withOutput(wikiSharingSchema).query("publicPage").withInput(wikiPublicRefSchema).withOutput(wikiPublicPageSchema).mutation("pin").withInput(wikiPinInputSchema).withOutput(wikiSharingSchema).mutation("unpin").withInput(wikiUnpinInputSchema).withOutput(wikiSharingSchema).query("pins").withInput(wikiPinsInputSchema).withOutput(wikiChannelPinsSchema).query("threads").withInput(wikiThreadsInWorkspaceSchema).withOutput(wikiThreadsSchema).mutation("comment").withInput(wikiCommentInWorkspaceSchema).withOutput(wikiCommentPostedSchema).mutation("reply").withInput(wikiReplyInWorkspaceSchema).withOutput(wikiCommentPostedSchema).mutation("resolve").withInput(wikiResolveInWorkspaceSchema).withOutput(wikiThreadSchema).mutation("deleteComment").withInput(wikiCommentRefInWorkspaceSchema).withOutput(wikiThreadsSchema).mutation("attach").withInput(wikiAttachInWorkspaceSchema).withOutput(wikiAttachTicketSchema).mutation("attachDone").withInput(wikiAttachDoneInWorkspaceSchema).withOutput(wikiFileSchema).query("files").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), path: external_exports.string().min(1).max(200) })).withOutput(wikiFilesSchema).mutation("removeFile").withInput(wikiFileRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
|
|
103466
|
+
var wikiUi = uiTokens("wiki");
|
|
103467
|
+
var WikiNavSlot = wikiUi.component("nav");
|
|
103468
|
+
|
|
103469
|
+
// ../../modules/wiki/contract/src/wiki.config.ts
|
|
103470
|
+
var wikiConfig = Config.define(() => ({ publicBaseUrl }));
|
|
103471
|
+
|
|
103472
|
+
// ../../modules/wiki/contract/src/wiki.events.ts
|
|
103473
|
+
var wikiMentionedPayloadSchemaDefinition = external_exports.object({
|
|
103474
|
+
workspaceId: external_exports.string().min(1),
|
|
103475
|
+
pageId: external_exports.string().min(1),
|
|
103476
|
+
threadId: external_exports.string().min(1),
|
|
103477
|
+
commentId: external_exports.string().min(1),
|
|
103478
|
+
mentionedUserId: external_exports.string().min(1),
|
|
103479
|
+
author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: external_exports.string().min(1) }).strict(),
|
|
103480
|
+
at: external_exports.iso.datetime()
|
|
103481
|
+
}).strict();
|
|
103482
|
+
|
|
103483
|
+
// ../../modules/wiki/contract/src/wiki-support-pages.ts
|
|
103484
|
+
var count13 = external_exports.number().int().nonnegative();
|
|
103485
|
+
var wikiSupportPageCountDefinition = external_exports.object({ pages: count13, workspaces: count13 }).strict();
|
|
103486
|
+
var wikiSupportPageCountSchema = wikiSupportPageCountDefinition;
|
|
103487
|
+
|
|
103488
|
+
// ../../modules/wiki/contract/src/wiki-locked-pages.ts
|
|
103489
|
+
var WIKI_LOCKED_PAGES_LIMIT = 200;
|
|
103490
|
+
var count14 = external_exports.number().int().nonnegative();
|
|
103491
|
+
var id7 = external_exports.string().min(1).max(200);
|
|
103492
|
+
var wikiLockedPagesDefinition = external_exports.object({
|
|
103493
|
+
pages: count14,
|
|
103494
|
+
workspaces: count14,
|
|
103495
|
+
locked: external_exports.array(external_exports.object({ workspaceId: id7, pageId: id7 }).strict()).max(WIKI_LOCKED_PAGES_LIMIT),
|
|
103496
|
+
truncated: external_exports.boolean()
|
|
103497
|
+
}).strict();
|
|
103498
|
+
var wikiLockedPagesSchema = wikiLockedPagesDefinition;
|
|
103499
|
+
|
|
103026
103500
|
// ../../modules/ops/contract/src/ops-functions.ts
|
|
103027
103501
|
var OPS_FUNCTION = {
|
|
103028
103502
|
/** Functions one lease may name. */
|
|
@@ -103081,12 +103555,12 @@ var funnelInputDefinition = external_exports.object({
|
|
|
103081
103555
|
to: external_exports.iso.datetime(),
|
|
103082
103556
|
bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
|
|
103083
103557
|
}).strict();
|
|
103084
|
-
var
|
|
103558
|
+
var count15 = external_exports.number().int().nonnegative();
|
|
103085
103559
|
var funnelCountsDefinition = external_exports.object({
|
|
103086
|
-
signUps:
|
|
103087
|
-
workspaces:
|
|
103088
|
-
activatedTeams:
|
|
103089
|
-
payingTeams:
|
|
103560
|
+
signUps: count15,
|
|
103561
|
+
workspaces: count15,
|
|
103562
|
+
activatedTeams: count15,
|
|
103563
|
+
payingTeams: count15
|
|
103090
103564
|
});
|
|
103091
103565
|
var funnelOutputDefinition = external_exports.object({
|
|
103092
103566
|
bucketMinutes: external_exports.number().int(),
|
|
@@ -103115,34 +103589,34 @@ var cohortOutputDefinition = external_exports.object({
|
|
|
103115
103589
|
promotionId: external_exports.string().nullable(),
|
|
103116
103590
|
plan: external_exports.string(),
|
|
103117
103591
|
paying: external_exports.boolean(),
|
|
103118
|
-
members:
|
|
103592
|
+
members: count15,
|
|
103119
103593
|
agents: external_exports.object({
|
|
103120
|
-
laze:
|
|
103121
|
-
connected:
|
|
103594
|
+
laze: count15,
|
|
103595
|
+
connected: count15,
|
|
103122
103596
|
firstLazeAgentAt: external_exports.iso.datetime().nullable()
|
|
103123
103597
|
}),
|
|
103124
|
-
turns:
|
|
103125
|
-
appsCreated:
|
|
103126
|
-
connectionsLinked:
|
|
103598
|
+
turns: count15,
|
|
103599
|
+
appsCreated: count15,
|
|
103600
|
+
connectionsLinked: count15,
|
|
103127
103601
|
/** Slack channels mirrored, Slack and Discord link and intake events, WhatsApp mirrors on. */
|
|
103128
103602
|
messaging: external_exports.object({
|
|
103129
|
-
slackChannels:
|
|
103130
|
-
slackEvents:
|
|
103131
|
-
discordEvents:
|
|
103132
|
-
whatsappMirrors:
|
|
103603
|
+
slackChannels: count15,
|
|
103604
|
+
slackEvents: count15,
|
|
103605
|
+
discordEvents: count15,
|
|
103606
|
+
whatsappMirrors: count15
|
|
103133
103607
|
}),
|
|
103134
103608
|
creatorLastMessageAt: external_exports.iso.datetime().nullable(),
|
|
103135
103609
|
/** The creator's last heartbeat from a Laze web or desktop window here; null when never. */
|
|
103136
103610
|
creatorLastSeenAt: external_exports.iso.datetime().nullable(),
|
|
103137
103611
|
/** Members whose last heartbeat here falls in the 7 days before `until`. */
|
|
103138
|
-
peopleSeenLast7Days:
|
|
103612
|
+
peopleSeenLast7Days: count15,
|
|
103139
103613
|
/** Live messages per UTC day; days with none are left out. */
|
|
103140
103614
|
days: external_exports.array(
|
|
103141
103615
|
external_exports.object({
|
|
103142
103616
|
day: external_exports.string(),
|
|
103143
|
-
byPeople:
|
|
103144
|
-
byAgents:
|
|
103145
|
-
people:
|
|
103617
|
+
byPeople: count15,
|
|
103618
|
+
byAgents: count15,
|
|
103619
|
+
people: count15
|
|
103146
103620
|
})
|
|
103147
103621
|
),
|
|
103148
103622
|
/** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
|
|
@@ -103166,29 +103640,29 @@ var capacityOutputDefinition = external_exports.object({
|
|
|
103166
103640
|
/** The last day of host load, oldest first. */
|
|
103167
103641
|
history: external_exports.array(hostLoadPointSchema)
|
|
103168
103642
|
});
|
|
103169
|
-
var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count:
|
|
103643
|
+
var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count15 }));
|
|
103170
103644
|
var snapshotOutputDefinition = external_exports.object({
|
|
103171
103645
|
workspaceId: external_exports.string(),
|
|
103172
103646
|
createdAt: external_exports.iso.datetime(),
|
|
103173
103647
|
plan: external_exports.string(),
|
|
103174
103648
|
status: external_exports.string(),
|
|
103175
|
-
seats: external_exports.object({ people:
|
|
103649
|
+
seats: external_exports.object({ people: count15, limit: external_exports.number().int().nullable() }),
|
|
103176
103650
|
membersByRole: tally,
|
|
103177
103651
|
invitesByStatus: tally,
|
|
103178
103652
|
agentsByKind: tally,
|
|
103179
103653
|
agentsByHosting: tally,
|
|
103180
|
-
agentsConnected:
|
|
103654
|
+
agentsConnected: count15,
|
|
103181
103655
|
flagsOn: external_exports.array(external_exports.string()),
|
|
103182
|
-
complimentaryComputers:
|
|
103656
|
+
complimentaryComputers: count15
|
|
103183
103657
|
});
|
|
103184
103658
|
var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
|
|
103185
103659
|
var eventCountsDefinition = external_exports.object({
|
|
103186
|
-
total:
|
|
103660
|
+
total: count15,
|
|
103187
103661
|
/** Per type: how many, and the stored bytes of their payloads and sealed copies. */
|
|
103188
103662
|
byType: external_exports.array(
|
|
103189
103663
|
external_exports.object({
|
|
103190
103664
|
eventType: external_exports.string(),
|
|
103191
|
-
count:
|
|
103665
|
+
count: count15,
|
|
103192
103666
|
payloadBytes: external_exports.number().nonnegative(),
|
|
103193
103667
|
encryptedCopyBytes: external_exports.number().nonnegative()
|
|
103194
103668
|
})
|
|
@@ -103242,9 +103716,9 @@ var databaseHealthDefinition = external_exports.object({
|
|
|
103242
103716
|
deadlocks: external_exports.number().nonnegative(),
|
|
103243
103717
|
tempBytes: external_exports.number().nonnegative(),
|
|
103244
103718
|
connections: external_exports.object({
|
|
103245
|
-
total:
|
|
103246
|
-
byState: external_exports.array(external_exports.object({ state: external_exports.string(), count:
|
|
103247
|
-
waitingOnLocks:
|
|
103719
|
+
total: count15,
|
|
103720
|
+
byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count15 })),
|
|
103721
|
+
waitingOnLocks: count15,
|
|
103248
103722
|
longestActiveSeconds: external_exports.number().nonnegative(),
|
|
103249
103723
|
longestIdleInTransactionSeconds: external_exports.number().nonnegative()
|
|
103250
103724
|
}),
|
|
@@ -103299,7 +103773,7 @@ var tenantAgentsDefinition = external_exports.object({
|
|
|
103299
103773
|
createdAt: external_exports.iso.datetime(),
|
|
103300
103774
|
modelLevel: external_exports.string().nullable(),
|
|
103301
103775
|
model: external_exports.string().nullable(),
|
|
103302
|
-
channels:
|
|
103776
|
+
channels: count15,
|
|
103303
103777
|
limitedUntil: external_exports.iso.datetime().nullable(),
|
|
103304
103778
|
limitedBy: external_exports.string().nullable(),
|
|
103305
103779
|
pausedAt: external_exports.iso.datetime().nullable(),
|
|
@@ -103353,8 +103827,8 @@ var tenantBillingDefinition = external_exports.object({
|
|
|
103353
103827
|
currencyChosen: external_exports.boolean(),
|
|
103354
103828
|
cancelAtPeriodEnd: external_exports.boolean(),
|
|
103355
103829
|
period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
|
|
103356
|
-
seats: external_exports.object({ people:
|
|
103357
|
-
complimentarySeats:
|
|
103830
|
+
seats: external_exports.object({ people: count15, limit: count15.nullable(), monthlyPrice: external_exports.number() }),
|
|
103831
|
+
complimentarySeats: count15.nullable(),
|
|
103358
103832
|
credits: external_exports.object({
|
|
103359
103833
|
included: external_exports.number(),
|
|
103360
103834
|
includedLeft: external_exports.number(),
|
|
@@ -103393,14 +103867,14 @@ var tenantVaultDefinition = external_exports.object({
|
|
|
103393
103867
|
external_exports.object({
|
|
103394
103868
|
subject: external_exports.string(),
|
|
103395
103869
|
most: external_exports.string(),
|
|
103396
|
-
maxLeaseSeconds:
|
|
103870
|
+
maxLeaseSeconds: count15.nullable(),
|
|
103397
103871
|
blocked: external_exports.boolean(),
|
|
103398
103872
|
approveNew: external_exports.boolean(),
|
|
103399
103873
|
updatedAt: external_exports.iso.datetime()
|
|
103400
103874
|
})
|
|
103401
103875
|
),
|
|
103402
103876
|
/** Connections waiting for an admin, counted by kind; never a name, label or field. */
|
|
103403
|
-
waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count:
|
|
103877
|
+
waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count15 }))
|
|
103404
103878
|
});
|
|
103405
103879
|
var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
|
|
103406
103880
|
var tenantWhatsappInputDefinition = external_exports.object({
|
|
@@ -103413,17 +103887,17 @@ var tenantWhatsappOutputDefinition = external_exports.object({
|
|
|
103413
103887
|
intake: external_exports.object({
|
|
103414
103888
|
since: external_exports.iso.datetime(),
|
|
103415
103889
|
until: external_exports.iso.datetime(),
|
|
103416
|
-
total:
|
|
103890
|
+
total: count15,
|
|
103417
103891
|
byKind: external_exports.array(
|
|
103418
103892
|
external_exports.object({
|
|
103419
103893
|
kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
|
|
103420
|
-
count:
|
|
103894
|
+
count: count15,
|
|
103421
103895
|
/** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
|
|
103422
|
-
aheadOfLaze: external_exports.object({ count:
|
|
103896
|
+
aheadOfLaze: external_exports.object({ count: count15, maxAheadMs: external_exports.number().int() }).optional()
|
|
103423
103897
|
})
|
|
103424
103898
|
),
|
|
103425
103899
|
/** The workspace's chat messages and changes dated over a second after Laze stored them. */
|
|
103426
|
-
chatAheadOfLaze: external_exports.object({ count:
|
|
103900
|
+
chatAheadOfLaze: external_exports.object({ count: count15, maxAheadMs: external_exports.number().int() }).optional()
|
|
103427
103901
|
})
|
|
103428
103902
|
});
|
|
103429
103903
|
var computerBrowserInputDefinition = external_exports.object({
|
|
@@ -103842,6 +104316,20 @@ var OPS_FUNCTIONS = {
|
|
|
103842
104316
|
input: serviceTracesInputDefinition,
|
|
103843
104317
|
output: serviceTracesOutputDefinition
|
|
103844
104318
|
}),
|
|
104319
|
+
"wiki.support_pages": entry({
|
|
104320
|
+
title: "Wiki pages in a Laze Support channel or the staff triage, and their workspaces, as counts",
|
|
104321
|
+
scope: "platform",
|
|
104322
|
+
view: "numbers",
|
|
104323
|
+
input: noInputDefinition,
|
|
104324
|
+
output: wikiSupportPageCountSchema
|
|
104325
|
+
}),
|
|
104326
|
+
"wiki.locked_pages": entry({
|
|
104327
|
+
title: "Wiki pages no one can edit, as workspace and page ids with their counts",
|
|
104328
|
+
scope: "platform",
|
|
104329
|
+
view: "numbers",
|
|
104330
|
+
input: noInputDefinition,
|
|
104331
|
+
output: wikiLockedPagesSchema
|
|
104332
|
+
}),
|
|
103845
104333
|
"tenant.snapshot": entry({
|
|
103846
104334
|
title: "One workspace's plan, members, agents and flags, as counts",
|
|
103847
104335
|
scope: "tenant",
|
|
@@ -104271,9 +104759,9 @@ function sessionIdOf({ session }) {
|
|
|
104271
104759
|
}
|
|
104272
104760
|
async function rushWakeHook({ context, args }) {
|
|
104273
104761
|
const claudePid = Number(flagText({ args, name: "claude-pid" }));
|
|
104274
|
-
const
|
|
104762
|
+
const id9 = flagText({ args, name: "rush-id" });
|
|
104275
104763
|
const program = flagText({ args, name: "rush-program" }) || "rush";
|
|
104276
|
-
if (!claudePid || !
|
|
104764
|
+
if (!claudePid || !id9) return 1;
|
|
104277
104765
|
if (!await claimRushGuard({ context, claudePid })) return 0;
|
|
104278
104766
|
const path = guardPathOf({ context, claudePid });
|
|
104279
104767
|
try {
|
|
@@ -104283,7 +104771,7 @@ async function rushWakeHook({ context, args }) {
|
|
|
104283
104771
|
const note = await readStateJson({ path: noted });
|
|
104284
104772
|
const { launch = {}, ...session } = note ?? {};
|
|
104285
104773
|
const lock = statePathOf({ context, kind: "waiters", profile: name3 });
|
|
104286
|
-
const rush = { id:
|
|
104774
|
+
const rush = { id: id9, program };
|
|
104287
104775
|
const known = note ? session : void 0;
|
|
104288
104776
|
const guard = { context, client, name: name3, lock, claudePid, session: known, rush, launch };
|
|
104289
104777
|
try {
|
|
@@ -105968,12 +106456,12 @@ In openclaw.json: secrets.providers.laze = { "source": "exec", "command": "laze"
|
|
|
105968
106456
|
"args": ["--profile", "<agent profile>", "vault", "exec-provider"], "jsonOnly": true }`;
|
|
105969
106457
|
function execProviderIds({ request: request2 }) {
|
|
105970
106458
|
const ids = request2?.ids;
|
|
105971
|
-
return Array.isArray(ids) ? ids.filter((
|
|
106459
|
+
return Array.isArray(ids) ? ids.filter((id9) => typeof id9 === "string") : [];
|
|
105972
106460
|
}
|
|
105973
|
-
function splitExecId({ id:
|
|
105974
|
-
const at8 =
|
|
105975
|
-
if (at8 === -1) return { connection:
|
|
105976
|
-
return { connection:
|
|
106461
|
+
function splitExecId({ id: id9 }) {
|
|
106462
|
+
const at8 = id9.indexOf("#");
|
|
106463
|
+
if (at8 === -1) return { connection: id9 };
|
|
106464
|
+
return { connection: id9.slice(0, at8), field: id9.slice(at8 + 1) };
|
|
105977
106465
|
}
|
|
105978
106466
|
function valueOf({
|
|
105979
106467
|
fields,
|
|
@@ -106008,29 +106496,29 @@ ${EXEC_PROVIDER_USAGE}`);
|
|
|
106008
106496
|
ids.length === 0 ? [] : (await resolveBatch({
|
|
106009
106497
|
context,
|
|
106010
106498
|
args,
|
|
106011
|
-
refs: [...new Set(ids.map((
|
|
106499
|
+
refs: [...new Set(ids.map((id9) => splitExecId({ id: id9 }).connection))]
|
|
106012
106500
|
})).filter((entry2) => entry2.connection).map((entry2) => entry2.ref)
|
|
106013
106501
|
);
|
|
106014
|
-
for (const
|
|
106015
|
-
const { connection, field } = splitExecId({ id:
|
|
106502
|
+
for (const id9 of ids) {
|
|
106503
|
+
const { connection, field } = splitExecId({ id: id9 });
|
|
106016
106504
|
if (!known.has(connection)) {
|
|
106017
|
-
errors[
|
|
106505
|
+
errors[id9] = { code: "NOT_FOUND" };
|
|
106018
106506
|
continue;
|
|
106019
106507
|
}
|
|
106020
106508
|
const outcome = await releaseBatch({
|
|
106021
106509
|
context,
|
|
106022
106510
|
args: noWait,
|
|
106023
106511
|
refs: [connection],
|
|
106024
|
-
reason: `OpenClaw resolves its ${
|
|
106025
|
-
command: ["openclaw", "secrets", "resolve",
|
|
106512
|
+
reason: `OpenClaw resolves its ${id9} secret reference`,
|
|
106513
|
+
command: ["openclaw", "secrets", "resolve", id9]
|
|
106026
106514
|
}).catch(() => ({ exitCode: -1 }));
|
|
106027
106515
|
if ("exitCode" in outcome) {
|
|
106028
|
-
errors[
|
|
106516
|
+
errors[id9] = { code: codeOfExit({ exitCode: outcome.exitCode }) };
|
|
106029
106517
|
continue;
|
|
106030
106518
|
}
|
|
106031
106519
|
const value = valueOf({ fields: outcome.released.get(connection)?.fields ?? {}, field });
|
|
106032
|
-
if (typeof value === "string") values[
|
|
106033
|
-
else errors[
|
|
106520
|
+
if (typeof value === "string") values[id9] = value;
|
|
106521
|
+
else errors[id9] = value;
|
|
106034
106522
|
}
|
|
106035
106523
|
const answer6 = {
|
|
106036
106524
|
protocolVersion: 1,
|
|
@@ -106164,7 +106652,7 @@ async function vaultSave({ context, args }) {
|
|
|
106164
106652
|
// src/services/vault-scrub-commands.service.ts
|
|
106165
106653
|
function lineOf6(channel) {
|
|
106166
106654
|
const where = channel.name ? `#${channel.name}` : channel.channelId;
|
|
106167
|
-
const found = Object.entries(channel.found).map(([vendor,
|
|
106655
|
+
const found = Object.entries(channel.found).map(([vendor, count16]) => `${vendor} ${count16}`).join(", ");
|
|
106168
106656
|
const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
|
|
106169
106657
|
return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
|
|
106170
106658
|
`;
|
|
@@ -106505,15 +106993,15 @@ var RECORD_WHATSAPP_BUSINESS_SEND_UNRESOLVED_COMMAND_TYPE = `${prefix}.unresolve
|
|
|
106505
106993
|
var WHATSAPP_BUSINESS_SEND_UNRESOLVED_EVENT_TYPE = `${prefix}.unresolved`;
|
|
106506
106994
|
var WHATSAPP_BUSINESS_EVIDENCE = ["sent", "delivered", "read"];
|
|
106507
106995
|
var whatsappBusinessEvidenceSchema = external_exports.enum(WHATSAPP_BUSINESS_EVIDENCE);
|
|
106508
|
-
var
|
|
106996
|
+
var id8 = external_exports.string().min(1).max(200);
|
|
106509
106997
|
var at7 = external_exports.iso.datetime();
|
|
106510
106998
|
var code3 = external_exports.string().min(1).max(64).regex(/^[a-z_]+$/);
|
|
106511
106999
|
var sendRef2 = {
|
|
106512
|
-
workspaceId:
|
|
106513
|
-
connectionId:
|
|
106514
|
-
sendId:
|
|
107000
|
+
workspaceId: id8,
|
|
107001
|
+
connectionId: id8,
|
|
107002
|
+
sendId: id8,
|
|
106515
107003
|
/** `wab-send:<send id>`: the stream's id. */
|
|
106516
|
-
stream:
|
|
107004
|
+
stream: id8,
|
|
106517
107005
|
at: at7
|
|
106518
107006
|
};
|
|
106519
107007
|
var requestedDefinition = external_exports.object({
|
|
@@ -106522,12 +107010,12 @@ var requestedDefinition = external_exports.object({
|
|
|
106522
107010
|
/** After this, with no answer from Meta, the send reads unconfirmed. */
|
|
106523
107011
|
sendBy: at7
|
|
106524
107012
|
});
|
|
106525
|
-
var heldDefinition = external_exports.object({ ...sendRef2, attentionId:
|
|
107013
|
+
var heldDefinition = external_exports.object({ ...sendRef2, attentionId: id8 });
|
|
106526
107014
|
var releasedDefinition = external_exports.object({ ...sendRef2, sendBy: at7 });
|
|
106527
|
-
var acceptedDefinition = external_exports.object({ ...sendRef2, wamid:
|
|
107015
|
+
var acceptedDefinition = external_exports.object({ ...sendRef2, wamid: id8 });
|
|
106528
107016
|
var evidencedDefinition = external_exports.object({
|
|
106529
107017
|
...sendRef2,
|
|
106530
|
-
wamid:
|
|
107018
|
+
wamid: id8,
|
|
106531
107019
|
evidence: whatsappBusinessEvidenceSchema
|
|
106532
107020
|
});
|
|
106533
107021
|
var refusedDefinition = external_exports.object({ ...sendRef2, code: code3 });
|
|
@@ -107217,7 +107705,8 @@ import { basename as basename13, resolve as resolve28 } from "node:path";
|
|
|
107217
107705
|
var WIKI_FILE_USAGE = ` laze wiki attach <path> <file> [--name <name>] [--type <mime>]
|
|
107218
107706
|
uploads a file to the page (up to 25 MB) and prints the markdown that embeds it
|
|
107219
107707
|
laze wiki files <path> the page's files, with their addresses
|
|
107220
|
-
laze wiki file <file-id> a short-lived link to a file's bytes
|
|
107708
|
+
laze wiki file <file-id> a short-lived link to a file's bytes
|
|
107709
|
+
laze wiki file rm <file-id> removes the file from its page, bytes too`;
|
|
107221
107710
|
function wikiFileMarkdown(file4) {
|
|
107222
107711
|
const label3 = file4.name.replace(/[[\]]/g, "");
|
|
107223
107712
|
return `${file4.contentType.startsWith("image/") ? "!" : ""}[${label3}](${file4.url})`;
|
|
@@ -107262,7 +107751,18 @@ var files2 = async ({ context, args, usage: usage2 }) => {
|
|
|
107262
107751
|
context.out(`${one.id} ${one.name} ${one.contentType} ${one.sizeBytes} ${one.url}
|
|
107263
107752
|
`);
|
|
107264
107753
|
};
|
|
107754
|
+
var remove10 = async ({ context, args, usage: usage2 }) => {
|
|
107755
|
+
const fileId = args.words[3];
|
|
107756
|
+
if (!fileId) throw new CliUsageError(usage2);
|
|
107757
|
+
const { client } = await signedIn({ context, args });
|
|
107758
|
+
const answer6 = await client.post("/api/wiki/file/remove", { fileId });
|
|
107759
|
+
if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
|
|
107760
|
+
`);
|
|
107761
|
+
context.out(`Removed ${fileId}
|
|
107762
|
+
`);
|
|
107763
|
+
};
|
|
107265
107764
|
var link = async ({ context, args, usage: usage2 }) => {
|
|
107765
|
+
if (args.words[2] === "rm") return remove10({ context, args, usage: usage2 });
|
|
107266
107766
|
const fileId = args.words[2];
|
|
107267
107767
|
if (!fileId) throw new CliUsageError(usage2);
|
|
107268
107768
|
const { client } = await signedIn({ context, args });
|
|
@@ -107291,9 +107791,10 @@ var USAGE21 = `Usage:
|
|
|
107291
107791
|
laze wiki rm <path> the page and its history; pages under it stay
|
|
107292
107792
|
laze wiki share <path> who sees a page or folder, and what they can do
|
|
107293
107793
|
[--visibility restricted|channel|internal|public] [--role view|edit] [--channel <channel>]
|
|
107294
|
-
[--grant <who>[:view|edit]]... [--revoke <who>]... [--reset]
|
|
107794
|
+
[--grant <who>[:view|edit]]... [--revoke <who>]... [--reset] [--take-back]
|
|
107295
107795
|
<who> is #channel, @group, an email, or a person's or agent's name. --reset takes the
|
|
107296
|
-
folder's sharing again.
|
|
107796
|
+
folder's sharing again. --take-back gives an Owner or Admin edit on a page no one can
|
|
107797
|
+
edit. Agents can only narrow sharing.
|
|
107297
107798
|
laze wiki pin <path> --channel <channel> [--role view|edit | --view-only]
|
|
107298
107799
|
shows the page or folder as a tab of the conversation; its members get edit, or view
|
|
107299
107800
|
laze wiki unpin <path> --channel <channel> the access the pin gave goes with it
|
|
@@ -107438,6 +107939,8 @@ async function wikiShare({ context, args }) {
|
|
|
107438
107939
|
let sharing = null;
|
|
107439
107940
|
if (args.flags.reset)
|
|
107440
107941
|
sharing = await client.post("/api/wiki/sharing/reset", { path });
|
|
107942
|
+
if (args.flags["take-back"])
|
|
107943
|
+
sharing = await client.post("/api/wiki/sharing/take-back", { path });
|
|
107441
107944
|
if (visibility || memberRole || channel) {
|
|
107442
107945
|
sharing = await client.post("/api/wiki/sharing", {
|
|
107443
107946
|
path,
|
|
@@ -107539,8 +108042,8 @@ async function roles({ context, args }) {
|
|
|
107539
108042
|
const catalogue = await client.get("/api/roles");
|
|
107540
108043
|
if (args.flags.json) return printJson11(context, catalogue);
|
|
107541
108044
|
for (const role2 of catalogue) {
|
|
107542
|
-
const
|
|
107543
|
-
context.out(`${role2.label} ${
|
|
108045
|
+
const count16 = `${role2.permissions.length} permissions`;
|
|
108046
|
+
context.out(`${role2.label} ${count16} ${role2.description}
|
|
107544
108047
|
`);
|
|
107545
108048
|
context.out(` ${role2.permissions.join(", ")}
|
|
107546
108049
|
`);
|