ente-cli 0.4.107 → 0.4.108
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/SKILL.md +38 -0
- package/dist/cli.mjs +530 -409
- package/dist/cli.mjs.map +4 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -4490,8 +4490,8 @@ function createEnvRefs(ownerLabel, declared) {
|
|
|
4490
4490
|
function isEnvRef(value) {
|
|
4491
4491
|
return typeof value === "object" && value !== null && typeof value.__envVarRef === "string";
|
|
4492
4492
|
}
|
|
4493
|
-
function use(
|
|
4494
|
-
const importedComponentDefinition =
|
|
4493
|
+
function use(definition5, options) {
|
|
4494
|
+
const importedComponentDefinition = definition5;
|
|
4495
4495
|
if (typeof importedComponentDefinition.componentDefinitionPath !== "string") {
|
|
4496
4496
|
throw new Error(
|
|
4497
4497
|
"Component definition does not have the required componentDefinitionPath property. This code only works in Convex runtime."
|
|
@@ -4530,7 +4530,7 @@ function use(definition4, options) {
|
|
|
4530
4530
|
envValues,
|
|
4531
4531
|
httpPrefix
|
|
4532
4532
|
]);
|
|
4533
|
-
return new InstalledComponent(
|
|
4533
|
+
return new InstalledComponent(definition5, name4);
|
|
4534
4534
|
}
|
|
4535
4535
|
function exportAppForAnalysis() {
|
|
4536
4536
|
const definitionType = { type: "app" };
|
|
@@ -4582,7 +4582,7 @@ function buildHttpMounts(childComponents) {
|
|
|
4582
4582
|
return httpMounts;
|
|
4583
4583
|
}
|
|
4584
4584
|
function serializeChildComponents(childComponents) {
|
|
4585
|
-
return childComponents.map(([name4,
|
|
4585
|
+
return childComponents.map(([name4, definition5, p]) => {
|
|
4586
4586
|
let env = null;
|
|
4587
4587
|
if (p !== null) {
|
|
4588
4588
|
env = [];
|
|
@@ -4601,10 +4601,10 @@ function serializeChildComponents(childComponents) {
|
|
|
4601
4601
|
}
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
const path9 =
|
|
4604
|
+
const path9 = definition5.componentDefinitionPath;
|
|
4605
4605
|
if (!path9)
|
|
4606
4606
|
throw new Error(
|
|
4607
|
-
"no .componentPath for component definition " + JSON.stringify(
|
|
4607
|
+
"no .componentPath for component definition " + JSON.stringify(definition5, null, 2)
|
|
4608
4608
|
);
|
|
4609
4609
|
return {
|
|
4610
4610
|
name: name4,
|
|
@@ -4736,10 +4736,10 @@ var init_components = __esm({
|
|
|
4736
4736
|
__defNormalProp20 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4737
4737
|
__publicField20 = (obj, key, value) => __defNormalProp20(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4738
4738
|
InstalledComponent = class {
|
|
4739
|
-
constructor(
|
|
4739
|
+
constructor(definition5, name4) {
|
|
4740
4740
|
__publicField20(this, "_definition");
|
|
4741
4741
|
__publicField20(this, "_name");
|
|
4742
|
-
this._definition =
|
|
4742
|
+
this._definition = definition5;
|
|
4743
4743
|
this._name = name4;
|
|
4744
4744
|
setReferencePath2(this, `_reference/childComponent/${name4}`);
|
|
4745
4745
|
}
|
|
@@ -5116,7 +5116,7 @@ var init_schema = __esm({
|
|
|
5116
5116
|
*/
|
|
5117
5117
|
export() {
|
|
5118
5118
|
return JSON.stringify({
|
|
5119
|
-
tables: Object.entries(this.tables).map(([tableName,
|
|
5119
|
+
tables: Object.entries(this.tables).map(([tableName, definition5]) => {
|
|
5120
5120
|
const {
|
|
5121
5121
|
indexes,
|
|
5122
5122
|
stagedDbIndexes,
|
|
@@ -5126,7 +5126,7 @@ var init_schema = __esm({
|
|
|
5126
5126
|
stagedVectorIndexes,
|
|
5127
5127
|
documentType,
|
|
5128
5128
|
stagedDocumentType
|
|
5129
|
-
} =
|
|
5129
|
+
} = definition5.export();
|
|
5130
5130
|
return {
|
|
5131
5131
|
tableName,
|
|
5132
5132
|
indexes,
|
|
@@ -5982,11 +5982,11 @@ var CommandBuilder = class {
|
|
|
5982
5982
|
const args = [];
|
|
5983
5983
|
for (let t = 0; t < arity; ++t)
|
|
5984
5984
|
args.push(` #${t}`);
|
|
5985
|
-
const
|
|
5985
|
+
const definition5 = `${nameSet.join(`,`)}${args.join(``)}`;
|
|
5986
5986
|
if (!inlineOptions && description) {
|
|
5987
|
-
detailedOptionList.push({ preferredName, nameSet, definition:
|
|
5987
|
+
detailedOptionList.push({ preferredName, nameSet, definition: definition5, description, required: required2 });
|
|
5988
5988
|
} else {
|
|
5989
|
-
segments.push(required2 ? `<${
|
|
5989
|
+
segments.push(required2 ? `<${definition5}>` : `[${definition5}]`);
|
|
5990
5990
|
}
|
|
5991
5991
|
}
|
|
5992
5992
|
segments.push(...this.arity.leading.map((name4) => `<${name4}>`));
|
|
@@ -6331,8 +6331,8 @@ var Cli = class _Cli {
|
|
|
6331
6331
|
for (const path9 of paths)
|
|
6332
6332
|
builder.addPath(path9);
|
|
6333
6333
|
this.registrations.set(commandClass, { specs, builder, index });
|
|
6334
|
-
for (const [key, { definition:
|
|
6335
|
-
|
|
6334
|
+
for (const [key, { definition: definition5 }] of specs.entries())
|
|
6335
|
+
definition5(builder, key);
|
|
6336
6336
|
builder.setContext({
|
|
6337
6337
|
commandClass
|
|
6338
6338
|
});
|
|
@@ -6563,8 +6563,8 @@ var Cli = class _Cli {
|
|
|
6563
6563
|
}, 0);
|
|
6564
6564
|
result += `
|
|
6565
6565
|
`;
|
|
6566
|
-
for (const { definition:
|
|
6567
|
-
result += ` ${this.format(colored).bold(
|
|
6566
|
+
for (const { definition: definition5, description: description2 } of options) {
|
|
6567
|
+
result += ` ${this.format(colored).bold(definition5.padEnd(maxDefinitionLength))} ${formatMarkdownish(description2, { format: this.format(colored), paragraphs: false })}`;
|
|
6568
6568
|
}
|
|
6569
6569
|
}
|
|
6570
6570
|
if (details !== ``) {
|
|
@@ -28451,7 +28451,7 @@ var history = external_exports.strictObject({
|
|
|
28451
28451
|
projection
|
|
28452
28452
|
});
|
|
28453
28453
|
var activityReadInputs = {
|
|
28454
|
-
getActivity: external_exports.strictObject({ activityId: id2, projection }),
|
|
28454
|
+
getActivity: external_exports.strictObject({ activityId: id2.optional(), spaceId: id2.optional(), externalKey: external_exports.string().trim().min(1).max(512).optional(), includeDeleted: external_exports.boolean().optional(), projection }).refine((input2) => input2.activityId !== void 0 ? input2.externalKey === void 0 && input2.spaceId === void 0 : input2.externalKey !== void 0 && input2.spaceId !== void 0, "Supply activityId or spaceId plus externalKey"),
|
|
28455
28455
|
listActivities: external_exports.strictObject({ limit: limit.default(ACTIVITY_READ_LIMITS.listDefault), ...windowFields, archived: external_exports.boolean().default(false), projection }).refine((input2) => !input2.archived || input2.before === void 0 && input2.after === void 0, { path: ["archived"], message: "Archived lists do not accept time filters" }).refine((input2) => input2.before === void 0 || input2.after === void 0 || input2.after < input2.before, { path: ["after"], message: "after must precede before" }),
|
|
28456
28456
|
searchActivities: external_exports.strictObject({ query: external_exports.string().trim().min(1), entityId: id2.optional(), type: external_exports.enum(ACTIVITY_TYPE_VALUES).optional(), limit: limit.default(ACTIVITY_READ_LIMITS.searchDefault), projection }),
|
|
28457
28457
|
listRecentActivities: history.refine((input2) => input2.before === void 0 || input2.after === void 0 || input2.after < input2.before, { path: ["after"], message: "after must precede before" })
|
|
@@ -28648,7 +28648,7 @@ function parseOperationAttrs(operation, pairs) {
|
|
|
28648
28648
|
}
|
|
28649
28649
|
|
|
28650
28650
|
// ente/version.ts
|
|
28651
|
-
var VERSION = "0.4.
|
|
28651
|
+
var VERSION = "0.4.108";
|
|
28652
28652
|
|
|
28653
28653
|
// ente/branding.ts
|
|
28654
28654
|
var NPM_REGISTRY = "https://registry.npmjs.org";
|
|
@@ -28676,54 +28676,220 @@ var PLATFORM_CREDENTIAL = {
|
|
|
28676
28676
|
profileEnvVar: "ENTE_PLATFORM_PROFILE"
|
|
28677
28677
|
};
|
|
28678
28678
|
|
|
28679
|
-
// ../packages/shared/src/
|
|
28680
|
-
|
|
28681
|
-
|
|
28682
|
-
var id4 = external_exports.string().min(1).max(100);
|
|
28683
|
-
var assignee = external_exports.enum(["all", "me", "meOrUnassigned", "unassigned", "user"]);
|
|
28684
|
-
var entityFilter = external_exports.strictObject({ coverage: external_exports.enum(["all", "tagged", "untagged"]).optional(), type: external_exports.enum(["person", "org", "project", "topic", "place", "object", "any"]).optional(), tags: tags.optional(), noParent: external_exports.boolean().optional() });
|
|
28685
|
-
var feedFilter = external_exports.strictObject({ activityType: external_exports.enum([...ACTIVITY_TYPE_VALUES, "all"]).optional(), deadlineFilter: text.optional(), sortOrder: external_exports.enum(["created-desc", "deadline-asc", "latest-desc", "latest-message-desc"]).optional(), assigneeFilter: assignee.optional(), assigneeUserId: id4.optional(), assigneeUserIds: external_exports.array(id4).max(100).optional(), entityIds: external_exports.array(id4).max(100).optional(), tags: tags.optional(), attributeFilters: external_exports.array(external_exports.strictObject({ key: text, value: text })).max(100).optional() });
|
|
28686
|
-
var activityFilter = feedFilter.omit({ assigneeUserId: true }).extend({ deadlineFilter: external_exports.enum(["due-now", "today", "this-week", "this-month", "all", "not-scheduled"]).optional(), taskStatus: external_exports.enum(["open", "completed", "all"]).optional(), search: text.optional() });
|
|
28687
|
-
var tabs = (filters, entity5 = false) => external_exports.strictObject({ activeId: id4, tabs: external_exports.array(external_exports.strictObject({ id: id4, name: external_exports.string().max(80).optional(), filters, ...entity5 ? { view: external_exports.enum(["list", "tree"]).optional() } : {} })).min(1).max(30) }).refine((v3) => new Set(v3.tabs.map((t) => t.id)).size === v3.tabs.length && v3.tabs.some((t) => t.id === v3.activeId), "Invalid tab selection");
|
|
28688
|
-
function setting(schema, defaultValue, description, examples, scope = "user", content = false) {
|
|
28689
|
-
return { schema, default: defaultValue, description, examples, scope, adminSettable: true, content };
|
|
28679
|
+
// ../packages/shared/src/input-fields.ts
|
|
28680
|
+
function isInputRecord(value) {
|
|
28681
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
28690
28682
|
}
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
|
|
28707
|
-
|
|
28683
|
+
function optionalStringArray(value) {
|
|
28684
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : void 0;
|
|
28685
|
+
}
|
|
28686
|
+
|
|
28687
|
+
// ../packages/shared/src/activity-operations.ts
|
|
28688
|
+
function isBoundedAgentIds(value) {
|
|
28689
|
+
return Array.isArray(value) && value.length <= MAX_ACTIVITY_AGENT_ASSIGNEES && value.every((id21) => typeof id21 === "string" && id21.length > 0);
|
|
28690
|
+
}
|
|
28691
|
+
function optionalBoolean(value) {
|
|
28692
|
+
return typeof value === "boolean" ? value : void 0;
|
|
28693
|
+
}
|
|
28694
|
+
function isActivityType(value) {
|
|
28695
|
+
return typeof value === "string" && ACTIVITY_TYPE_VALUES.some((type) => type === value);
|
|
28696
|
+
}
|
|
28697
|
+
function stringAttributes(value) {
|
|
28698
|
+
const result = {};
|
|
28699
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
28700
|
+
if (typeof entry !== "string") return void 0;
|
|
28701
|
+
result[key] = entry;
|
|
28702
|
+
}
|
|
28703
|
+
return result;
|
|
28704
|
+
}
|
|
28705
|
+
function updateAttributes(value) {
|
|
28706
|
+
const result = {};
|
|
28707
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
28708
|
+
if (typeof entry !== "string" && entry !== null) return void 0;
|
|
28709
|
+
result[key] = entry;
|
|
28710
|
+
}
|
|
28711
|
+
return result;
|
|
28712
|
+
}
|
|
28713
|
+
var invalid = (message3) => ({ ok: false, message: message3 });
|
|
28714
|
+
function parseActivityCreateInput(args, name4 = "activities_create") {
|
|
28715
|
+
if ("createdAt" in args) return invalid(`${name4} createdAt is no longer accepted; use sourceCreatedAt.`);
|
|
28716
|
+
if (args.sourceCreatedAt !== void 0 && !isSourceCreatedAtInput(args.sourceCreatedAt))
|
|
28717
|
+
return invalid(`${name4} sourceCreatedAt must be an object: { date: "YYYY-MM-DD", time?: "HH:mm" | null, timezone?: string }`);
|
|
28718
|
+
const entityIds = optionalStringArray(args.entityIds);
|
|
28719
|
+
if (!entityIds?.length) return invalid(`${name4} requires entityIds to be a non-empty string array`);
|
|
28720
|
+
if (!isActivityType(args.type)) return invalid(`${name4} requires type to be one of: ${ACTIVITY_TYPE_VALUES.join(", ")}`);
|
|
28721
|
+
if (args.deadline !== void 0 && !isDeadlineInput(args.deadline))
|
|
28722
|
+
return invalid(`${name4} deadline must be a readable deadline object or number`);
|
|
28723
|
+
if (args.agentAssigneeIds !== void 0 && !isBoundedAgentIds(args.agentAssigneeIds))
|
|
28724
|
+
return invalid(`${name4} agentAssigneeIds must be an array of at most ${MAX_ACTIVITY_AGENT_ASSIGNEES} non-empty IDs`);
|
|
28725
|
+
const attributes2 = isInputRecord(args.attributes) ? stringAttributes(args.attributes) : void 0;
|
|
28726
|
+
if (args.attributes === null || isInputRecord(args.attributes) && attributes2 === void 0)
|
|
28727
|
+
return invalid(`${name4} attributes must contain string values`);
|
|
28728
|
+
return { ok: true, value: {
|
|
28729
|
+
entityIds,
|
|
28730
|
+
type: args.type,
|
|
28731
|
+
title: typeof args.title === "string" ? args.title : void 0,
|
|
28732
|
+
content: typeof args.content === "string" ? args.content : typeof args.contentPlainText === "string" ? args.contentPlainText : void 0,
|
|
28733
|
+
contentPlainText: typeof args.contentPlainText === "string" ? args.contentPlainText : void 0,
|
|
28734
|
+
spaceId: typeof args.spaceId === "string" ? args.spaceId : void 0,
|
|
28735
|
+
deadline: isDeadlineInput(args.deadline) ? args.deadline : void 0,
|
|
28736
|
+
completed: optionalBoolean(args.completed),
|
|
28737
|
+
attributes: attributes2,
|
|
28738
|
+
sourceCreatedAt: isSourceCreatedAtInput(args.sourceCreatedAt) ? args.sourceCreatedAt : void 0,
|
|
28739
|
+
tags: optionalStringArray(args.tags),
|
|
28740
|
+
assigneeIds: optionalStringArray(args.assigneeIds),
|
|
28741
|
+
agentAssigneeIds: isBoundedAgentIds(args.agentAssigneeIds) ? args.agentAssigneeIds : void 0,
|
|
28742
|
+
assigneeEmails: optionalStringArray(args.assigneeEmails),
|
|
28743
|
+
autoLinkPersonalSpace: optionalBoolean(args.autoLinkPersonalSpace)
|
|
28744
|
+
} };
|
|
28745
|
+
}
|
|
28746
|
+
function parseActivityUpdateInput(args, name4 = "activities_update") {
|
|
28747
|
+
if (typeof args.activityId !== "string") return invalid(`${name4} requires string activityId`);
|
|
28748
|
+
if ("deadline" in args && !isNullableDeadlineInput(args.deadline))
|
|
28749
|
+
return invalid(`${name4} deadline must be a readable deadline object, number, or null`);
|
|
28750
|
+
if (args.type !== void 0 && !isActivityType(args.type))
|
|
28751
|
+
return invalid(`${name4} type must be one of: ${ACTIVITY_TYPE_VALUES.join(", ")}`);
|
|
28752
|
+
const entityIds = optionalStringArray(args.entityIds);
|
|
28753
|
+
if (args.entityIds !== void 0 && !entityIds?.length) return invalid(`${name4} entityIds must be a non-empty string array`);
|
|
28754
|
+
if (args.attributes !== void 0 && !isInputRecord(args.attributes)) return invalid(`${name4} attributes must be an object`);
|
|
28755
|
+
const attributes2 = isInputRecord(args.attributes) ? updateAttributes(args.attributes) : void 0;
|
|
28756
|
+
if (isInputRecord(args.attributes) && attributes2 === void 0) return invalid(`${name4} attributes must contain string or null values`);
|
|
28757
|
+
for (const key of ["assigneeIds", "assigneeEmails"])
|
|
28758
|
+
if (args[key] !== void 0 && !optionalStringArray(args[key])) return invalid(`${name4} ${key} must be an array of strings`);
|
|
28759
|
+
if (args.agentAssigneeIds !== void 0 && !isBoundedAgentIds(args.agentAssigneeIds))
|
|
28760
|
+
return invalid(`${name4} agentAssigneeIds must be an array of at most ${MAX_ACTIVITY_AGENT_ASSIGNEES} non-empty IDs`);
|
|
28761
|
+
return { ok: true, value: {
|
|
28762
|
+
activityId: args.activityId,
|
|
28763
|
+
title: typeof args.title === "string" ? args.title : void 0,
|
|
28764
|
+
content: typeof args.content === "string" ? args.content : void 0,
|
|
28765
|
+
completed: optionalBoolean(args.completed),
|
|
28766
|
+
deadline: isNullableDeadlineInput(args.deadline) ? args.deadline : void 0,
|
|
28767
|
+
entityIds,
|
|
28768
|
+
type: isActivityType(args.type) ? args.type : void 0,
|
|
28769
|
+
attributes: attributes2,
|
|
28770
|
+
assigneeIds: optionalStringArray(args.assigneeIds),
|
|
28771
|
+
assigneeEmails: optionalStringArray(args.assigneeEmails),
|
|
28772
|
+
agentAssigneeIds: isBoundedAgentIds(args.agentAssigneeIds) ? args.agentAssigneeIds : void 0
|
|
28773
|
+
} };
|
|
28774
|
+
}
|
|
28775
|
+
|
|
28776
|
+
// ../packages/shared/src/activity-write-operations.ts
|
|
28777
|
+
var ACTIVITY_WRITE_LIMITS = { wireArray: 8192, agentAssignees: MAX_ACTIVITY_AGENT_ASSIGNEES };
|
|
28778
|
+
var id4 = external_exports.string().min(1).max(128).refine((value) => value.trim() === value, "Copy IDs unchanged");
|
|
28779
|
+
var ids = external_exports.array(id4).max(ACTIVITY_WRITE_LIMITS.wireArray);
|
|
28780
|
+
var strings = external_exports.array(external_exports.string()).max(ACTIVITY_WRITE_LIMITS.wireArray);
|
|
28781
|
+
var readableActivityDate = external_exports.strictObject({ date: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/), time: external_exports.string().regex(/^\d{2}:\d{2}$/).nullable().optional(), timezone: external_exports.string().optional() }).refine(validDate, "Invalid readable date (calendar and timezone checked at runtime)");
|
|
28782
|
+
function validDate(value) {
|
|
28783
|
+
try {
|
|
28784
|
+
readableDateTimeToEpochMs(value, "date");
|
|
28785
|
+
return true;
|
|
28786
|
+
} catch {
|
|
28787
|
+
return false;
|
|
28788
|
+
}
|
|
28789
|
+
}
|
|
28790
|
+
var activityWriteDeadline = external_exports.union([external_exports.number(), readableActivityDate]);
|
|
28791
|
+
var nullableDeadline = activityWriteDeadline.nullable();
|
|
28792
|
+
var assignees = { assigneeIds: ids.optional(), assigneeEmails: strings.optional(), agentAssigneeIds: ids.max(MAX_ACTIVITY_AGENT_ASSIGNEES).optional() };
|
|
28793
|
+
var stringAttributes2 = external_exports.record(attributeKey, external_exports.string());
|
|
28794
|
+
var patchAttributes = attributeStringPatch;
|
|
28795
|
+
var updateFields = { activityId: id4, title: external_exports.string().optional(), content: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION).optional(), deadline: nullableDeadline.optional(), completed: external_exports.boolean().optional(), entityIds: ids.min(1).optional(), type: external_exports.enum(ACTIVITY_TYPE_VALUES).optional(), attributes: patchAttributes.optional(), ...assignees };
|
|
28796
|
+
var assignment = external_exports.strictObject({ activityId: id4, action: external_exports.enum(["replace", "add", "remove", "clear"]), assigneeIds: ids.optional(), assigneeEmails: strings.optional(), agentAssigneeIds: ids.describe("At most 20 IDs for replace. Add/remove/clear retain the installed bounded wire array; add deduplicates before enforcing at most 20 assigned agents in the resulting task. Assignment grants no access.").optional() }).refine((value) => value.action !== "replace" || value.agentAssigneeIds === void 0 || value.agentAssigneeIds.length <= MAX_ACTIVITY_AGENT_ASSIGNEES, { path: ["agentAssigneeIds"], message: "Too many replacement agent assignees" });
|
|
28797
|
+
var attributes = external_exports.strictObject({ activityId: id4, action: external_exports.enum(["set", "remove", "replace", "clear"]), attributes: stringAttributes2.optional(), keys: strings.optional() }).refine((value) => value.action !== "set" || value.attributes !== void 0 && Object.keys(value.attributes).length > 0, { path: ["attributes"], message: "set requires attributes" }).refine((value) => value.action !== "remove" || value.keys !== void 0 && value.keys.length > 0, { path: ["keys"], message: "remove requires keys" });
|
|
28798
|
+
var activityWriteInputs = {
|
|
28799
|
+
createActivity: external_exports.strictObject({ externalKey: external_exports.string().trim().min(1).max(512).optional(), spaceId: id4.describe("Explicit destination space ID; choose it before creating this activity."), entityIds: ids.min(1), type: external_exports.enum(ACTIVITY_TYPE_VALUES), title: external_exports.string().optional(), content: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION).optional(), deadline: activityWriteDeadline.optional(), completed: external_exports.boolean().optional(), attributes: stringAttributes2.optional(), sourceCreatedAt: readableActivityDate.describe(ACTIVITY_CREATE_SOURCE_CREATED_AT_DESCRIPTION).optional(), tags: strings.optional(), ...assignees, autoLinkPersonalSpace: external_exports.boolean().optional() }),
|
|
28800
|
+
updateActivity: external_exports.strictObject(updateFields),
|
|
28801
|
+
updateActivityTitle: external_exports.strictObject({ activityId: id4, title: external_exports.string() }),
|
|
28802
|
+
updateActivityDeadline: external_exports.strictObject({ activityId: id4, deadline: nullableDeadline.optional() }),
|
|
28803
|
+
updateActivityContent: external_exports.strictObject({ activityId: id4, markdown: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION) }),
|
|
28804
|
+
updateActivityAttributes: attributes,
|
|
28805
|
+
updateActivityAssignees: assignment,
|
|
28806
|
+
toggleActivityCompleted: external_exports.strictObject({ activityId: id4 }),
|
|
28807
|
+
addActivityMessage: external_exports.strictObject({ activityId: id4, content: external_exports.string().regex(/\S/, "Message content is required") }),
|
|
28808
|
+
deleteActivity: external_exports.strictObject({ activityId: id4 }),
|
|
28809
|
+
restoreActivity: external_exports.strictObject({ activityId: id4 }),
|
|
28810
|
+
batchUpdateTasks: external_exports.strictObject({ updates: external_exports.array(external_exports.strictObject({ activityId: id4, completed: external_exports.boolean().optional(), deadline: activityWriteDeadline.optional(), attributes: patchAttributes.optional() })).max(ACTIVITY_WRITE_LIMITS.wireArray) })
|
|
28708
28811
|
};
|
|
28709
|
-
var
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28715
|
-
|
|
28716
|
-
|
|
28717
|
-
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28812
|
+
var activityWriteAliases = { activities_create: "createActivity", activities_update: "updateActivity", activities_assign: "updateActivityAssignees", activities_addMessage: "addActivityMessage", activities_delete: "deleteActivity", activities_restore: "restoreActivity" };
|
|
28813
|
+
function isActivityWriteOperationName(name4) {
|
|
28814
|
+
return Object.hasOwn(activityWriteInputs, name4);
|
|
28815
|
+
}
|
|
28816
|
+
function parserMismatch(operation) {
|
|
28817
|
+
throw new OperationInputError(operation, [{ path: [], reason: "custom" }]);
|
|
28818
|
+
}
|
|
28819
|
+
function parseActivityWriteRequest(operation, raw) {
|
|
28820
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) raw = Object.fromEntries(Object.entries(raw).filter(([key, value]) => value !== void 0 || !Object.hasOwn(activityWriteInputs[operation].shape, key)));
|
|
28821
|
+
switch (operation) {
|
|
28822
|
+
case "createActivity": {
|
|
28823
|
+
const input2 = parseOperationInput(operation, activityWriteInputs.createActivity, raw);
|
|
28824
|
+
if (!parseActivityCreateInput(input2, operation).ok) return parserMismatch(operation);
|
|
28825
|
+
return { operation, input: input2 };
|
|
28826
|
+
}
|
|
28827
|
+
case "updateActivity": {
|
|
28828
|
+
const input2 = parseOperationInput(operation, activityWriteInputs.updateActivity, raw);
|
|
28829
|
+
if (!parseActivityUpdateInput(input2, operation).ok) return parserMismatch(operation);
|
|
28830
|
+
return { operation, input: input2 };
|
|
28831
|
+
}
|
|
28832
|
+
case "updateActivityTitle":
|
|
28833
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityTitle, raw) };
|
|
28834
|
+
case "updateActivityDeadline":
|
|
28835
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityDeadline, raw) };
|
|
28836
|
+
case "updateActivityContent":
|
|
28837
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityContent, raw) };
|
|
28838
|
+
case "updateActivityAttributes":
|
|
28839
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityAttributes, raw) };
|
|
28840
|
+
case "updateActivityAssignees":
|
|
28841
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityAssignees, raw) };
|
|
28842
|
+
case "toggleActivityCompleted":
|
|
28843
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.toggleActivityCompleted, raw) };
|
|
28844
|
+
case "addActivityMessage":
|
|
28845
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.addActivityMessage, raw) };
|
|
28846
|
+
case "deleteActivity":
|
|
28847
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.deleteActivity, raw) };
|
|
28848
|
+
case "restoreActivity":
|
|
28849
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.restoreActivity, raw) };
|
|
28850
|
+
case "batchUpdateTasks":
|
|
28851
|
+
return { operation, input: parseOperationInput(operation, activityWriteInputs.batchUpdateTasks, raw) };
|
|
28852
|
+
}
|
|
28853
|
+
}
|
|
28854
|
+
|
|
28855
|
+
// ../packages/shared/src/activity-write-operation-results.ts
|
|
28856
|
+
var id5 = external_exports.string().min(1);
|
|
28857
|
+
var ack = external_exports.strictObject({ success: external_exports.literal(true) });
|
|
28858
|
+
var activityWriteResults = {
|
|
28859
|
+
createActivity: external_exports.strictObject({ activityId: id5, autoLinkedEntities: external_exports.array(external_exports.strictObject({ entityId: id5, name: external_exports.string() })) }),
|
|
28860
|
+
updateActivity: ack,
|
|
28861
|
+
updateActivityTitle: ack,
|
|
28862
|
+
updateActivityDeadline: ack,
|
|
28863
|
+
updateActivityContent: ack,
|
|
28864
|
+
updateActivityAttributes: ack,
|
|
28865
|
+
updateActivityAssignees: ack,
|
|
28866
|
+
toggleActivityCompleted: external_exports.strictObject({ completed: external_exports.boolean() }),
|
|
28867
|
+
addActivityMessage: external_exports.strictObject({ messageId: id5 }),
|
|
28868
|
+
deleteActivity: ack,
|
|
28869
|
+
restoreActivity: ack,
|
|
28870
|
+
batchUpdateTasks: external_exports.discriminatedUnion("status", [
|
|
28871
|
+
external_exports.strictObject({ status: external_exports.literal("completed"), updated: external_exports.number().int().nonnegative(), total: external_exports.number().int().nonnegative(), committedActivityIds: external_exports.array(id5) }),
|
|
28872
|
+
external_exports.strictObject({ status: external_exports.literal("partial"), updated: external_exports.number().int().nonnegative(), total: external_exports.number().int().nonnegative(), committedActivityIds: external_exports.array(id5), failedIndex: external_exports.number().int().nonnegative(), error: external_exports.strictObject({ code: external_exports.string(), message: external_exports.literal("Task item failed") }) })
|
|
28873
|
+
]).refine((value) => value.updated === value.committedActivityIds.length && (value.status === "completed" ? value.updated === value.total : value.failedIndex === value.updated && value.failedIndex < value.total), "Inconsistent batch commit receipt")
|
|
28724
28874
|
};
|
|
28725
|
-
|
|
28726
|
-
|
|
28875
|
+
function checked(schema, raw) {
|
|
28876
|
+
return parseZodOperationResult("activityWrite", schema, raw, "Invalid activity write result");
|
|
28877
|
+
}
|
|
28878
|
+
function projectActivityWriteResult(operation, raw) {
|
|
28879
|
+
switch (operation) {
|
|
28880
|
+
case "createActivity":
|
|
28881
|
+
return checked(activityWriteResults.createActivity, raw);
|
|
28882
|
+
case "toggleActivityCompleted":
|
|
28883
|
+
return checked(activityWriteResults.toggleActivityCompleted, raw);
|
|
28884
|
+
case "addActivityMessage":
|
|
28885
|
+
return checked(activityWriteResults.addActivityMessage, { messageId: checked(id5, raw) });
|
|
28886
|
+
case "batchUpdateTasks":
|
|
28887
|
+
return checked(activityWriteResults.batchUpdateTasks, raw);
|
|
28888
|
+
default:
|
|
28889
|
+
if (raw !== null) throw new OperationResultError(operation, "Invalid activity write result");
|
|
28890
|
+
return checked(ack, { success: true });
|
|
28891
|
+
}
|
|
28892
|
+
}
|
|
28727
28893
|
|
|
28728
28894
|
// ../packages/shared/src/operation-contract.ts
|
|
28729
28895
|
function operationAliases(mapping, name4, profile = "full") {
|
|
@@ -28789,17 +28955,135 @@ function operationResultSchema(validator) {
|
|
|
28789
28955
|
}
|
|
28790
28956
|
}
|
|
28791
28957
|
|
|
28958
|
+
// ../packages/shared/src/activity-write-catalog.ts
|
|
28959
|
+
var composite = /* @__PURE__ */ new Set(["updateActivityAssignees", "updateActivityAttributes", "toggleActivityCompleted", "batchUpdateTasks"]);
|
|
28960
|
+
var descriptions = {
|
|
28961
|
+
createActivity: "Create in an explicit space with existing owners. externalKey reserves an agent-and-space task key atomically; retries return the first ID without applying changed fields, including completed/deleted tasks. sourceCreatedAt is for imports. Missing owner grants require human review.",
|
|
28962
|
+
updateActivity: "Update supplied fields in the activity's actual space. Attributes merge string values and delete null-valued keys. Explicit completed is idempotent. Owners must already belong to the activity space. Provider-backed email body and type restrictions remain enforced.",
|
|
28963
|
+
updateActivityTitle: "Set or clear an activity title. Existing revision and verified updater bookkeeping stay in the same transaction.",
|
|
28964
|
+
updateActivityDeadline: "Set a readable or finite epoch deadline; null clears it and omission leaves it unchanged in this profile.",
|
|
28965
|
+
updateActivityContent: "Replace the ordinary activity body with markdown, preserving revisions and read-only provider-email policy. Version-window editing is a separate operation family.",
|
|
28966
|
+
updateActivityAttributes: "Set merges strings, remove deletes selected keys, replace deletes previously observed keys and applies strings, clear deletes previously observed keys. Uses the existing authorized read then write profile; concurrent unseen keys may survive replace/clear. Receipt acknowledges the committing mutation; legacy enrichment is a later observation.",
|
|
28967
|
+
updateActivityAssignees: "Replace/add/remove/clear task assignees. Replace clears omitted humans and preserves omitted agents; clear removes both. Add deduplicates. Assignment grants no access. Concurrent changes may overwrite the prior read. Receipt reports commit; legacy enrichment is later.",
|
|
28968
|
+
toggleActivityCompleted: "Toggle using the native read-then-set profile. The inverse is selected before the write, so concurrent toggles are not serialized as repeated atomic flips. Receipt reports the completed value committed by this write. Explicit updateActivity.completed remains idempotent.",
|
|
28969
|
+
addActivityMessage: "Append an ordinary activity discussion message with verified author and agent identity. This is separate from human-only Native Messenger and from edits to the parent activity body.",
|
|
28970
|
+
deleteActivity: "Archive an activity through the existing lifecycle and task cleanup. Already archived records are unchanged.",
|
|
28971
|
+
restoreActivity: "Restore an activity through the existing lifecycle, ownership, actor and task index rules. Already active records are unchanged.",
|
|
28972
|
+
batchUpdateTasks: "Validate the complete batch structure before dispatch, then commit each item sequentially through the ordinary activity update. Stop at the first failure and report committed IDs/count and failed index. Earlier commits remain; later items never run. No automatic retry or whole-batch rollback."
|
|
28973
|
+
};
|
|
28974
|
+
function propertySchema(schema) {
|
|
28975
|
+
if (typeof schema !== "object") throw new Error("Activity write property schema must be an object");
|
|
28976
|
+
return schema;
|
|
28977
|
+
}
|
|
28978
|
+
function definition(name4) {
|
|
28979
|
+
const schema = external_exports.toJSONSchema(activityWriteInputs[name4], { io: "input" });
|
|
28980
|
+
const properties = schema.properties ?? {};
|
|
28981
|
+
const conditions = name4 === "updateActivityAssignees" ? [{ anyOf: [
|
|
28982
|
+
{ type: "object", properties: { action: { enum: ["add", "remove", "clear"] } } },
|
|
28983
|
+
{ type: "object", properties: { action: { const: "replace" }, agentAssigneeIds: { type: "array", items: { type: "string", minLength: 1, maxLength: 128 }, maxItems: ACTIVITY_WRITE_LIMITS.agentAssignees } } }
|
|
28984
|
+
] }] : name4 === "updateActivityAttributes" ? [{ anyOf: [
|
|
28985
|
+
{ type: "object", properties: { ...properties, action: { enum: ["replace", "clear"] } }, additionalProperties: false },
|
|
28986
|
+
{ type: "object", properties: { ...properties, action: { const: "set" }, attributes: { ...propertySchema(properties.attributes), minProperties: 1 } }, required: ["attributes"], additionalProperties: false },
|
|
28987
|
+
{ type: "object", properties: { ...properties, action: { const: "remove" }, keys: { ...propertySchema(properties.keys), minItems: 1 } }, required: ["keys"], additionalProperties: false }
|
|
28988
|
+
] }] : void 0;
|
|
28989
|
+
const resultSchema3 = external_exports.toJSONSchema(activityWriteResults[name4]);
|
|
28990
|
+
return {
|
|
28991
|
+
name: name4,
|
|
28992
|
+
aliases: operationAliases(activityWriteAliases, name4),
|
|
28993
|
+
actor: "agent",
|
|
28994
|
+
description: descriptions[name4],
|
|
28995
|
+
inputSchema: { ...schema, type: "object", properties, additionalProperties: false, ...conditions ? { allOf: conditions } : {} },
|
|
28996
|
+
resultSchema: resultSchema3,
|
|
28997
|
+
outputSchema: operationDataOutputSchema(resultSchema3),
|
|
28998
|
+
errorSchema: operationErrorSchema,
|
|
28999
|
+
capability: "write",
|
|
29000
|
+
environment: "content",
|
|
29001
|
+
executionProfile: "full",
|
|
29002
|
+
resultProjection: "commit-receipt",
|
|
29003
|
+
availability: { hosted: name4 !== "updateActivity", external: Object.values(activityWriteAliases).some((operation) => operation === name4), browserHuman: false, agentConnection: Object.values(activityWriteAliases).some((operation) => operation === name4), executionProfiles: ["full", "public-cli"], runtime: composite.has(name4) ? "action" : "mutation" },
|
|
29004
|
+
limits: ACTIVITY_WRITE_LIMITS,
|
|
29005
|
+
profiles: {
|
|
29006
|
+
rest: { available: ["createActivity", "updateActivity", "updateActivityAssignees", "deleteActivity", "restoreActivity"].includes(name4), result: "commit-receipt" },
|
|
29007
|
+
canonical: { result: "commit-receipt", wholeActionRollback: !composite.has(name4), concurrency: composite.has(name4) ? "existing-native-stages" : "protected-transaction" },
|
|
29008
|
+
legacyNative: { primary: false, result: name4 === "updateActivityAssignees" || name4 === "updateActivityAttributes" ? "later-enrichment-observation" : "legacy-wrapper", wholeActionRollback: false },
|
|
29009
|
+
legacyMcp: { primary: false, result: "installed-alias-wrapper", createEmptyAutoLinks: "omitted", messageSuccessFlag: false },
|
|
29010
|
+
publicUi: { primary: false, existingDomainValidators: true, ownerlessCreate: name4 === "createActivity", typedDatabaseAttributes: name4 === "updateActivity" || name4 === "updateActivityAttributes" },
|
|
29011
|
+
realtime: { primary: false, available: name4 === "createActivity", source: "verified-session-createTask", speechAndLeaseRequired: true, finishAndResultValidation: "same-transaction" }
|
|
29012
|
+
},
|
|
29013
|
+
compatibilityAliases: Object.entries(activityWriteAliases).filter(([, operation]) => operation === name4).map(([alias]) => alias),
|
|
29014
|
+
resourcePolicy: { selector: name4 === "createActivity" ? "explicit-activity-space" : name4 === "batchUpdateTasks" ? "ordered-activity-ids" : "actual-activity-space", creation: "explicit-space-and-headless-owners", existing: "actual-activity-space", runBounds: "intersect-live-write-scope", humanGrants: "required-outside-accepted-owner-Personal-exception", resultValidation: "before-each-commit" }
|
|
29015
|
+
};
|
|
29016
|
+
}
|
|
29017
|
+
var definitions = new Map(Object.keys(activityWriteInputs).filter(isActivityWriteOperationName).map((name4) => [name4, definition(name4)]));
|
|
29018
|
+
var activityWriteCatalog = [...definitions.values()];
|
|
29019
|
+
var activityWriteRestBindings = [
|
|
29020
|
+
{ operation: "createActivity", path: "/api/external/activities", method: "POST", handlerKey: "externalActivityCreate", schema: "ActivityCreateResponse" },
|
|
29021
|
+
{ operation: "updateActivity", path: "/api/external/activities", method: "PATCH", handlerKey: "externalActivityUpdate", schema: "ActivityUpdateResponse" },
|
|
29022
|
+
{ operation: "updateActivityAssignees", path: "/api/external/activity-assignees", method: "PATCH", handlerKey: "externalActivityAssignees", schema: "ActivityAssigneesResponse" },
|
|
29023
|
+
{ operation: "deleteActivity", path: "/api/external/activities", method: "DELETE", handlerKey: "externalActivityDelete", schema: "ActivityDeleteResponse" },
|
|
29024
|
+
{ operation: "restoreActivity", path: "/api/external/activities/restore", method: "POST", handlerKey: "externalActivityRestore", schema: "ActivityRestoreResponse" }
|
|
29025
|
+
];
|
|
29026
|
+
|
|
29027
|
+
// ../packages/shared/src/account-settings.ts
|
|
29028
|
+
var text = external_exports.string().max(200);
|
|
29029
|
+
var tags = external_exports.array(text).max(100);
|
|
29030
|
+
var id6 = external_exports.string().min(1).max(100);
|
|
29031
|
+
var assignee = external_exports.enum(["all", "me", "meOrUnassigned", "unassigned", "user"]);
|
|
29032
|
+
var entityFilter = external_exports.strictObject({ coverage: external_exports.enum(["all", "tagged", "untagged"]).optional(), type: external_exports.enum(["person", "org", "project", "topic", "place", "object", "any"]).optional(), tags: tags.optional(), noParent: external_exports.boolean().optional() });
|
|
29033
|
+
var feedFilter = external_exports.strictObject({ activityType: external_exports.enum([...ACTIVITY_TYPE_VALUES, "all"]).optional(), deadlineFilter: text.optional(), sortOrder: external_exports.enum(["created-desc", "deadline-asc", "latest-desc", "latest-message-desc"]).optional(), assigneeFilter: assignee.optional(), assigneeUserId: id6.optional(), assigneeUserIds: external_exports.array(id6).max(100).optional(), entityIds: external_exports.array(id6).max(100).optional(), tags: tags.optional(), attributeFilters: external_exports.array(external_exports.strictObject({ key: text, value: text })).max(100).optional() });
|
|
29034
|
+
var activityFilter = feedFilter.omit({ assigneeUserId: true }).extend({ deadlineFilter: external_exports.enum(["due-now", "today", "this-week", "this-month", "all", "not-scheduled"]).optional(), taskStatus: external_exports.enum(["open", "completed", "all"]).optional(), search: text.optional() });
|
|
29035
|
+
var tabs = (filters, entity5 = false) => external_exports.strictObject({ activeId: id6, tabs: external_exports.array(external_exports.strictObject({ id: id6, name: external_exports.string().max(80).optional(), filters, ...entity5 ? { view: external_exports.enum(["list", "tree"]).optional() } : {} })).min(1).max(30) }).refine((v3) => new Set(v3.tabs.map((t) => t.id)).size === v3.tabs.length && v3.tabs.some((t) => t.id === v3.activeId), "Invalid tab selection");
|
|
29036
|
+
function setting(schema, defaultValue, description, examples, scope = "user", content = false) {
|
|
29037
|
+
return { schema, default: defaultValue, description, examples, scope, adminSettable: true, content };
|
|
29038
|
+
}
|
|
29039
|
+
var mailSetupSchema = external_exports.strictObject({ provider: external_exports.enum(["imap", "google", "microsoft"]), email: external_exports.string().trim().email().max(254), username: external_exports.string().max(254).optional(), imapHost: external_exports.string().min(1).max(253).optional(), imapPort: external_exports.number().int().min(1).max(65535).optional(), imapSecure: external_exports.boolean().optional(), smtpHost: external_exports.string().min(1).max(253).optional(), smtpPort: external_exports.number().int().min(1).max(65535).optional(), smtpSecure: external_exports.boolean().optional(), folders: external_exports.array(external_exports.string().min(1).max(200).regex(/^[^\r\n\0]+$/)).max(20).default([]), signatureHtml: external_exports.string().max(2e4).default("") }).refine((v3) => v3.provider !== "imap" || Boolean(v3.imapHost && v3.imapPort && v3.imapSecure !== void 0 && v3.smtpHost && v3.smtpPort && v3.smtpSecure !== void 0), "IMAP and SMTP endpoints required");
|
|
29040
|
+
var accountSettings = {
|
|
29041
|
+
mailSetup: setting(mailSetupSchema.nullable(), null, "Prepare non-secret mail connection metadata and a 15-minute, single-use finish link for the exact signed-in target. The user enters the password directly in Ente; never ask for or pass a password. OAuth remains user-session-only. Folders are synchronized first; signature is sanitized. Applying null revokes an unused link.", [null], "user", true),
|
|
29042
|
+
language: setting(external_exports.enum(["en", "de"]), "en", "Language used by the account.", ["en", "de"]),
|
|
29043
|
+
voiceInputEnabled: setting(external_exports.boolean(), false, "Show voice input controls; does not grant device microphone permission.", [true]),
|
|
29044
|
+
themeMode: setting(external_exports.enum(["system", "light", "dark", "time"]), "system", "Appearance theme.", ["system", "dark"]),
|
|
29045
|
+
dashboardEntityTabs: setting(tabs(entityFilter, true), { activeId: "default", tabs: [{ id: "default", filters: {} }] }, "Replace ordered dashboard entity tabs.", [{ activeId: "default", tabs: [{ id: "default", filters: {} }] }]),
|
|
29046
|
+
dashboardActivityTabs: setting(tabs(activityFilter), { activeId: "default", tabs: [{ id: "default", filters: {} }] }, "Replace ordered dashboard activity tabs.", [{ activeId: "default", tabs: [{ id: "default", filters: {} }] }]),
|
|
29047
|
+
feedDefaultsMode: setting(external_exports.enum(["last-used", "fixed"]), "last-used", "Use last-used or fixed feed filters.", ["fixed"]),
|
|
29048
|
+
defaultFeedFilter: setting(feedFilter, {}, "Fixed activity feed filters.", [{}]),
|
|
29049
|
+
defaultEntityFilter: setting(entityFilter, {}, "Fixed entity filters.", [{}]),
|
|
29050
|
+
notificationPreferences: setting(external_exports.strictObject({ deadlineEnabled: external_exports.boolean(), deadlineScope: external_exports.enum(["assigned", "assignedOrUnassigned"]), messageEnabled: external_exports.boolean(), timezone: external_exports.string().min(1).max(100) }), { deadlineEnabled: false, deadlineScope: "assigned", messageEnabled: false, timezone: "Europe/Berlin" }, "Notification preferences for the exact target space; requires target membership.", [{ deadlineEnabled: false, deadlineScope: "assigned", messageEnabled: false, timezone: "Europe/Berlin" }], "user\xD7space"),
|
|
29051
|
+
defaultAgentId: setting(id6, null, "Select an existing active recording agent accessible to the target user. No access grants are added. Exported null means unset; clearing by applying null is refused.", ["agent-id"]),
|
|
29052
|
+
defaultMailAgentId: setting(id6.nullable(), null, "Own Personal mail agent; selecting grants no mailbox rights.", [null]),
|
|
29053
|
+
mailFormatting: setting(external_exports.strictObject({ color: external_exports.union([external_exports.literal("default"), external_exports.string().regex(/^#[0-9a-fA-F]{6}$/)]), size: external_exports.enum(["10", "12", "14", "16", "18", "24", "32"]) }), { color: "default", size: "14" }, "Default outgoing mail text formatting.", [{ color: "default", size: "14" }]),
|
|
29054
|
+
agentDictionary: setting(external_exports.string().max(5e4), "", "Recording dictionary; content is redacted in audit records.", ["Example company"], "user", true),
|
|
29055
|
+
agentPrompt: setting(external_exports.string().max(5e4), "", "Prompt of the target recording agent; content is redacted in audit records.", ["Structure recordings as notes."], "agent", true)
|
|
29056
|
+
};
|
|
29057
|
+
var settingKeys = Object.keys(accountSettings);
|
|
29058
|
+
var settingsTargetSchema = external_exports.strictObject({ userId: id6.optional(), email: external_exports.string().trim().email().max(320).optional(), spaceId: id6.optional(), spaceName: external_exports.string().trim().min(1).max(200).optional() }).refine((t) => Boolean(t.userId) !== Boolean(t.email), "Choose userId or exact email").refine((t) => !(t.spaceId && t.spaceName), "Choose spaceId or exact spaceName");
|
|
29059
|
+
var companySetupDocumentSchema = external_exports.strictObject({
|
|
29060
|
+
version: external_exports.literal(1),
|
|
29061
|
+
company: external_exports.strictObject({ id: id6.optional(), name: external_exports.string().trim().min(1).max(120), seatLimit: external_exports.number().int().min(1).max(1e3) }),
|
|
29062
|
+
spaces: external_exports.array(external_exports.strictObject({ key: external_exports.string().min(1).max(80), id: id6.optional(), name: external_exports.string().trim().min(1).max(120), color: external_exports.string().max(80).default("kale"), kanban: external_exports.strictObject({ version: external_exports.literal(1), attributeKey: external_exports.string().min(1).max(80), columns: external_exports.array(external_exports.strictObject({ id: external_exports.string(), kind: external_exports.enum(["empty", "value", "done"]), value: external_exports.string().optional(), labels: external_exports.strictObject({ en: external_exports.string(), de: external_exports.string() }) })).min(3).max(6) }).optional() })).max(20),
|
|
29063
|
+
members: external_exports.array(external_exports.strictObject({ email: external_exports.string().trim().email().max(254), spaces: external_exports.array(external_exports.strictObject({ key: external_exports.string(), role: external_exports.enum(["owner", "admin", "member"]).default("member"), settings: external_exports.record(external_exports.string(), external_exports.unknown()).default({}) })).max(20), settings: external_exports.record(external_exports.string(), external_exports.unknown()).default({}) })).max(100),
|
|
29064
|
+
invitationActions: external_exports.array(external_exports.strictObject({ invitationId: id6, action: external_exports.enum(["resend", "revoke"]) })).max(100).default([]),
|
|
29065
|
+
dictionaryTerms: external_exports.array(external_exports.string().trim().min(1).max(200)).max(500).default([])
|
|
29066
|
+
});
|
|
29067
|
+
var settingsInputSchemas = {
|
|
29068
|
+
settings_describe: external_exports.strictObject({ mailDiscoveryEmail: external_exports.string().trim().email().max(254).optional() }),
|
|
29069
|
+
settings_company: external_exports.strictObject({ action: external_exports.enum(["describe", "get", "apply", "invite"]), companyId: id6.optional(), email: external_exports.string().trim().email().max(254).optional(), spaceName: external_exports.string().trim().min(1).max(200).optional(), preset: external_exports.record(external_exports.string(), external_exports.unknown()).optional(), document: external_exports.unknown().optional(), commit: external_exports.boolean().optional(), fingerprint: external_exports.string().optional(), expectedVersion: external_exports.string().optional(), idempotencyKey: external_exports.string().min(1).max(200).optional() }),
|
|
29070
|
+
settings_get: external_exports.strictObject({ target: settingsTargetSchema }),
|
|
29071
|
+
settings_apply: external_exports.strictObject({ target: settingsTargetSchema, changes: external_exports.record(external_exports.string(), external_exports.unknown()).optional(), commit: external_exports.boolean().optional(), fingerprint: external_exports.string().optional(), expectedVersion: external_exports.string().optional(), idempotencyKey: external_exports.string().min(1).max(200).optional() })
|
|
29072
|
+
};
|
|
29073
|
+
var SETTINGS_OPERATIONS = Object.keys(settingsInputSchemas);
|
|
29074
|
+
var settingsOperationDefinitions = SETTINGS_OPERATIONS.map((name4) => ({ name: name4, description: name4 === "settings_company" ? "Describe, export, or plan/apply a declarative manual company setup. Action invite prepares one exact-email invitation using companyId, email, optional exact spaceName and preset, without a full document: shared spaces, kanban, exact-email members/invitations and catalog presets. No provider calls. Hosted apply requires an exact-plan approval card." : name4 === "settings_describe" ? "Describe the admin-settable settings catalog with types, defaults and examples." : name4 === "settings_get" ? "Resolve an exact email (no search/listing) or userId; export settings and the resolved account identity and spaces. Select a space by exact spaceName or spaceId." : "Plan account settings changes (default dry run). Commit requires the returned fingerprint, expectedVersion and idempotencyKey. Hosted commit also requires the explicit plan approval card.", inputSchema: external_exports.toJSONSchema(settingsInputSchemas[name4]) }));
|
|
29075
|
+
|
|
28792
29076
|
// ../packages/shared/src/workspace-operations.ts
|
|
28793
|
-
var
|
|
29077
|
+
var id7 = external_exports.string().min(1).max(128).refine((value) => value.trim() === value);
|
|
28794
29078
|
var name = external_exports.string().trim().min(1);
|
|
28795
29079
|
var WORKSPACE_FOOTER_MEMBER_LIMIT = 1e3;
|
|
28796
29080
|
var workspaceInputs = {
|
|
28797
29081
|
listSpaces: external_exports.strictObject({}),
|
|
28798
|
-
listSpaceMembers: external_exports.strictObject({ spaceId:
|
|
29082
|
+
listSpaceMembers: external_exports.strictObject({ spaceId: id7 }),
|
|
28799
29083
|
createSpace: external_exports.strictObject({ name, color: external_exports.string().default("kale"), memberEmails: external_exports.array(external_exports.string()).optional() }),
|
|
28800
|
-
updateSpace: external_exports.strictObject({ spaceId:
|
|
28801
|
-
addSpaceMember: external_exports.strictObject({ spaceId:
|
|
28802
|
-
removeSpaceMember: external_exports.strictObject({ spaceId:
|
|
29084
|
+
updateSpace: external_exports.strictObject({ spaceId: id7, name: external_exports.string().optional(), color: external_exports.string().optional(), scope: external_exports.string().optional() }).refine((value) => value.name !== void 0 || value.color !== void 0 || value.scope !== void 0),
|
|
29085
|
+
addSpaceMember: external_exports.strictObject({ spaceId: id7, email: external_exports.string().trim().min(1) }),
|
|
29086
|
+
removeSpaceMember: external_exports.strictObject({ spaceId: id7, memberUserId: id7 })
|
|
28803
29087
|
};
|
|
28804
29088
|
var compactSpaceValidator = v.object({ spaceId: v.id("spaces"), name: v.string(), scope: v.optional(v.string()), isPersonal: v.boolean() });
|
|
28805
29089
|
var workspaceResults = {
|
|
@@ -28841,18 +29125,18 @@ function parseWorkspaceRequest(operation, raw) {
|
|
|
28841
29125
|
return { operation, input: parseOperationInput(operation, workspaceInputs.removeSpaceMember, raw) };
|
|
28842
29126
|
}
|
|
28843
29127
|
}
|
|
28844
|
-
var legacySpace = external_exports.object({ _id:
|
|
29128
|
+
var legacySpace = external_exports.object({ _id: id7, _creationTime: external_exports.number(), name: external_exports.string(), color: external_exports.string() }).catchall(external_exports.json().optional());
|
|
28845
29129
|
var legacyWorkspaceWireResults = {
|
|
28846
29130
|
listSpaces: external_exports.array(legacySpace.extend({ role: external_exports.enum(["owner", "admin", "member"]), memberEmails: external_exports.array(external_exports.string()) })),
|
|
28847
29131
|
updateSpace: legacySpace
|
|
28848
29132
|
};
|
|
28849
29133
|
var workspacePublicCliResults = {
|
|
28850
|
-
createSpaceSource: external_exports.strictObject({ createdSpaceId:
|
|
28851
|
-
listSpaces: external_exports.array(external_exports.strictObject({ _id:
|
|
29134
|
+
createSpaceSource: external_exports.strictObject({ createdSpaceId: id7, createdMembershipId: id7 }),
|
|
29135
|
+
listSpaces: external_exports.array(external_exports.strictObject({ _id: id7, name: external_exports.string().optional(), role: external_exports.enum(["owner", "admin", "member"]).optional(), memberEmails: external_exports.array(external_exports.string()).optional() })),
|
|
28852
29136
|
updateSpace: legacyWorkspaceWireResults.updateSpace,
|
|
28853
|
-
listSpaceMembers: external_exports.array(external_exports.strictObject({ userId:
|
|
29137
|
+
listSpaceMembers: external_exports.array(external_exports.strictObject({ userId: id7.optional(), name: external_exports.string().optional(), email: external_exports.string().optional() }))
|
|
28854
29138
|
};
|
|
28855
|
-
var
|
|
29139
|
+
var descriptions2 = {
|
|
28856
29140
|
listSpaces: "List currently accessible active spaces. Native results contain spaceId, name, optional scope and isPersonal. The installed external profile retains full space documents with role and memberEmails.",
|
|
28857
29141
|
listSpaceMembers: "List visible coworker identities in a space. Unavailable to Personal-only agent connections.",
|
|
28858
29142
|
createSpace: "Create a space without changing the active space. Requires spaces:manage and the existing inheriting Personal-agent authority. Color defaults to kale.",
|
|
@@ -28867,7 +29151,7 @@ var workspaceCatalog = Object.keys(workspaceInputs).filter(isWorkspaceOperationN
|
|
|
28867
29151
|
name: name4,
|
|
28868
29152
|
aliases: operationAliases(workspaceAliases, name4),
|
|
28869
29153
|
actor: "agent",
|
|
28870
|
-
description:
|
|
29154
|
+
description: descriptions2[name4],
|
|
28871
29155
|
inputSchema: { type: "object", properties: schema.properties ?? {}, required: schema.required ?? [], additionalProperties: false, ...name4 === "updateSpace" ? { anyOf: ["name", "color", "scope"].map((field) => ({ required: [field] })) } : {} },
|
|
28872
29156
|
resultSchema: resultSchema3,
|
|
28873
29157
|
errorSchema: operationErrorSchema,
|
|
@@ -29291,7 +29575,7 @@ var SchemaDefinition = class {
|
|
|
29291
29575
|
*/
|
|
29292
29576
|
export() {
|
|
29293
29577
|
return JSON.stringify({
|
|
29294
|
-
tables: Object.entries(this.tables).map(([tableName,
|
|
29578
|
+
tables: Object.entries(this.tables).map(([tableName, definition5]) => {
|
|
29295
29579
|
const {
|
|
29296
29580
|
indexes,
|
|
29297
29581
|
stagedDbIndexes,
|
|
@@ -29301,7 +29585,7 @@ var SchemaDefinition = class {
|
|
|
29301
29585
|
stagedVectorIndexes,
|
|
29302
29586
|
documentType,
|
|
29303
29587
|
stagedDocumentType
|
|
29304
|
-
} =
|
|
29588
|
+
} = definition5.export();
|
|
29305
29589
|
return {
|
|
29306
29590
|
tableName,
|
|
29307
29591
|
indexes,
|
|
@@ -29346,13 +29630,13 @@ var _systemSchema = defineSchema({
|
|
|
29346
29630
|
var AGENT_CONTEXT_PAGE_LIMIT = 50;
|
|
29347
29631
|
var AGENT_CONTEXT_PAGE_DEFAULT = 20;
|
|
29348
29632
|
var cursor = external_exports.string().min(1).regex(/\S/);
|
|
29349
|
-
var
|
|
29633
|
+
var id8 = external_exports.string().min(1).regex(/\S/);
|
|
29350
29634
|
var page = { cursor: cursor.optional(), limit: external_exports.number().int().min(1).max(AGENT_CONTEXT_PAGE_LIMIT).default(AGENT_CONTEXT_PAGE_DEFAULT) };
|
|
29351
29635
|
var attention = external_exports.enum(["user", "agent", "none"]);
|
|
29352
29636
|
var agentContextInputs = {
|
|
29353
29637
|
agent_config_get: external_exports.strictObject({}),
|
|
29354
29638
|
agent_threads_list: external_exports.strictObject({ ...page, includeArchived: external_exports.boolean().default(false), attention: attention.optional() }),
|
|
29355
|
-
agent_thread_get: external_exports.strictObject({ ...page, threadId:
|
|
29639
|
+
agent_thread_get: external_exports.strictObject({ ...page, threadId: id8 })
|
|
29356
29640
|
};
|
|
29357
29641
|
function parseAgentContextInput(operation, raw) {
|
|
29358
29642
|
switch (operation) {
|
|
@@ -29365,15 +29649,15 @@ function parseAgentContextInput(operation, raw) {
|
|
|
29365
29649
|
}
|
|
29366
29650
|
}
|
|
29367
29651
|
var agentContextBrowserInputs = {
|
|
29368
|
-
agent_config_get: external_exports.strictObject({ agent_id:
|
|
29652
|
+
agent_config_get: external_exports.strictObject({ agent_id: id8.max(100) }),
|
|
29369
29653
|
agent_threads_list: external_exports.strictObject({
|
|
29370
|
-
agent_id:
|
|
29654
|
+
agent_id: id8.max(100),
|
|
29371
29655
|
cursor: cursor.max(2e3).optional(),
|
|
29372
29656
|
limit: page.limit,
|
|
29373
29657
|
include_archived: external_exports.boolean().default(false),
|
|
29374
29658
|
attention: attention.optional()
|
|
29375
29659
|
}),
|
|
29376
|
-
agent_thread_get: external_exports.strictObject({ agent_id:
|
|
29660
|
+
agent_thread_get: external_exports.strictObject({ agent_id: id8.max(100), thread_id: id8.max(100), cursor: cursor.max(2e3).optional(), limit: page.limit })
|
|
29377
29661
|
};
|
|
29378
29662
|
|
|
29379
29663
|
// ../packages/shared/src/agent-context-results.ts
|
|
@@ -30076,21 +30360,21 @@ function parseSpaceChangeCommand(value) {
|
|
|
30076
30360
|
}
|
|
30077
30361
|
|
|
30078
30362
|
// ../packages/shared/src/space-change-operations.ts
|
|
30079
|
-
var
|
|
30363
|
+
var id9 = external_exports.string().min(1);
|
|
30080
30364
|
var action = external_exports.enum(["move", "detach", "keep", "trash"]);
|
|
30081
|
-
var entity = external_exports.looseObject({ entityId:
|
|
30082
|
-
var member = external_exports.looseObject({ userId:
|
|
30083
|
-
var nullableSpace = external_exports.looseObject({ _id:
|
|
30365
|
+
var entity = external_exports.looseObject({ entityId: id9, name: external_exports.string() });
|
|
30366
|
+
var member = external_exports.looseObject({ userId: id9, role: external_exports.enum(["owner", "admin", "member"]), name: external_exports.string() });
|
|
30367
|
+
var nullableSpace = external_exports.looseObject({ _id: id9, name: external_exports.string() }).nullable();
|
|
30084
30368
|
var status = external_exports.looseObject({
|
|
30085
30369
|
operation: external_exports.looseObject({
|
|
30086
|
-
_id:
|
|
30370
|
+
_id: id9,
|
|
30087
30371
|
kind: external_exports.enum(["entity", "space", "activity"]),
|
|
30088
30372
|
action,
|
|
30089
30373
|
status: external_exports.enum(["building", "review", "running", "complete", "failed", "cancelled"]),
|
|
30090
|
-
sourceSpaceId:
|
|
30091
|
-
targetSpaceId:
|
|
30092
|
-
entityId:
|
|
30093
|
-
activityId:
|
|
30374
|
+
sourceSpaceId: id9,
|
|
30375
|
+
targetSpaceId: id9.optional(),
|
|
30376
|
+
entityId: id9.optional(),
|
|
30377
|
+
activityId: id9.optional(),
|
|
30094
30378
|
version: external_exports.number().int().min(1),
|
|
30095
30379
|
total: external_exports.number().int().nonnegative(),
|
|
30096
30380
|
processed: external_exports.number().int().nonnegative(),
|
|
@@ -30103,13 +30387,13 @@ var status = external_exports.looseObject({
|
|
|
30103
30387
|
});
|
|
30104
30388
|
var items = external_exports.looseObject({
|
|
30105
30389
|
page: external_exports.array(external_exports.looseObject({
|
|
30106
|
-
_id:
|
|
30107
|
-
operationId:
|
|
30390
|
+
_id: id9,
|
|
30391
|
+
operationId: id9,
|
|
30108
30392
|
kind: external_exports.enum(["activity", "entity"]),
|
|
30109
30393
|
title: external_exports.string(),
|
|
30110
30394
|
action,
|
|
30111
30395
|
grants: external_exports.array(entity),
|
|
30112
|
-
removedAssignees: external_exports.array(external_exports.looseObject({ userId:
|
|
30396
|
+
removedAssignees: external_exports.array(external_exports.looseObject({ userId: id9, name: external_exports.string() })),
|
|
30113
30397
|
owners: external_exports.array(entity),
|
|
30114
30398
|
done: external_exports.boolean()
|
|
30115
30399
|
})),
|
|
@@ -30119,7 +30403,7 @@ var items = external_exports.looseObject({
|
|
|
30119
30403
|
pageStatus: external_exports.enum(["SplitRecommended", "SplitRequired"]).nullable().optional()
|
|
30120
30404
|
});
|
|
30121
30405
|
var spaceChangeResults = {
|
|
30122
|
-
prepare: external_exports.strictObject({ operationId:
|
|
30406
|
+
prepare: external_exports.strictObject({ operationId: id9 }),
|
|
30123
30407
|
status,
|
|
30124
30408
|
items,
|
|
30125
30409
|
setAction: external_exports.null(),
|
|
@@ -32800,11 +33084,11 @@ var fieldInputSchema = external_exports.strictObject({ label: fieldLabelSchema,
|
|
|
32800
33084
|
var externalFieldValueSchema = external_exports.strictObject({ valueId: external_exports.string(), fieldId: external_exports.string(), label: external_exports.string(), type: fieldTypeSchema, value: external_exports.string() });
|
|
32801
33085
|
|
|
32802
33086
|
// ../packages/shared/src/read-result-dtos.ts
|
|
32803
|
-
var
|
|
33087
|
+
var id10 = external_exports.string().min(1);
|
|
32804
33088
|
var icon = external_exports.enum([.../* @__PURE__ */ new Set([...entityCustomIconIds, ...activityCustomIconIds, ...legacyCustomIconIds])]);
|
|
32805
33089
|
var readParentDetail = external_exports.strictObject({ name: external_exports.string(), role: external_exports.string().optional() });
|
|
32806
33090
|
var entityReadFields = {
|
|
32807
|
-
_id:
|
|
33091
|
+
_id: id10,
|
|
32808
33092
|
name: external_exports.string(),
|
|
32809
33093
|
type: external_exports.enum(ENTITY_TYPE_VALUES),
|
|
32810
33094
|
displayName: external_exports.string().optional(),
|
|
@@ -32818,7 +33102,7 @@ var entityReadFields = {
|
|
|
32818
33102
|
fields: external_exports.array(externalFieldValueSchema),
|
|
32819
33103
|
tags: external_exports.array(external_exports.string()).optional(),
|
|
32820
33104
|
aliases: external_exports.array(external_exports.string()).optional(),
|
|
32821
|
-
createdBy:
|
|
33105
|
+
createdBy: id10,
|
|
32822
33106
|
updatedAt: external_exports.number(),
|
|
32823
33107
|
lastActivityAt: external_exports.number().optional(),
|
|
32824
33108
|
archived: external_exports.boolean(),
|
|
@@ -32826,7 +33110,7 @@ var entityReadFields = {
|
|
|
32826
33110
|
};
|
|
32827
33111
|
var publicEntityReadDto = external_exports.strictObject(entityReadFields);
|
|
32828
33112
|
var activityReadFields = {
|
|
32829
|
-
_id:
|
|
33113
|
+
_id: id10,
|
|
32830
33114
|
title: external_exports.string().optional(),
|
|
32831
33115
|
type: external_exports.enum(ACTIVITY_TYPE_VALUES),
|
|
32832
33116
|
contentPlainText: external_exports.string().optional(),
|
|
@@ -32834,46 +33118,46 @@ var activityReadFields = {
|
|
|
32834
33118
|
completed: external_exports.boolean().optional(),
|
|
32835
33119
|
shortId: external_exports.number().optional(),
|
|
32836
33120
|
tags: external_exports.array(external_exports.string()).optional(),
|
|
32837
|
-
assigneeIds: external_exports.array(
|
|
32838
|
-
agentAssigneeIds: external_exports.array(
|
|
33121
|
+
assigneeIds: external_exports.array(id10).optional(),
|
|
33122
|
+
agentAssigneeIds: external_exports.array(id10).optional(),
|
|
32839
33123
|
attributes: external_exports.record(external_exports.string(), external_exports.json()).optional(),
|
|
32840
33124
|
createdAt: external_exports.number(),
|
|
32841
33125
|
updatedAt: external_exports.number(),
|
|
32842
|
-
spaceId:
|
|
32843
|
-
createdBy:
|
|
32844
|
-
createdByAgentId:
|
|
32845
|
-
updatedByAgentId:
|
|
33126
|
+
spaceId: id10,
|
|
33127
|
+
createdBy: id10,
|
|
33128
|
+
createdByAgentId: id10.optional(),
|
|
33129
|
+
updatedByAgentId: id10.optional(),
|
|
32846
33130
|
revisionCount: external_exports.number().optional(),
|
|
32847
|
-
attachments: external_exports.array(external_exports.strictObject({ storageId:
|
|
33131
|
+
attachments: external_exports.array(external_exports.strictObject({ storageId: id10, name: external_exports.string(), mimeType: external_exports.string(), sizeBytes: external_exports.number().optional() })).optional()
|
|
32848
33132
|
};
|
|
32849
33133
|
var publicActivityReadDto = external_exports.strictObject(activityReadFields);
|
|
32850
33134
|
var selectPublicEntityRead = external_exports.object(entityReadFields);
|
|
32851
33135
|
var selectPublicActivityRead = external_exports.object(activityReadFields);
|
|
32852
33136
|
|
|
32853
33137
|
// ../packages/shared/src/entity-read-operation-results.ts
|
|
32854
|
-
var
|
|
33138
|
+
var id11 = external_exports.string().min(1);
|
|
32855
33139
|
var entityReadDocument = publicEntityReadDto;
|
|
32856
33140
|
var entityReadRichDocument = external_exports.strictObject({ ...publicEntityReadDto.shape, displayName: external_exports.string(), parentNames: external_exports.array(external_exports.string()), parentDetails: external_exports.array(readParentDetail) });
|
|
32857
33141
|
var entityReadActivity = publicActivityReadDto;
|
|
32858
33142
|
var parentDetail = readParentDetail;
|
|
32859
|
-
var space = external_exports.strictObject({ spaceId:
|
|
33143
|
+
var space = external_exports.strictObject({ spaceId: id11, spaceName: external_exports.string(), memberEmails: external_exports.array(external_exports.string()), scope: external_exports.string().optional() });
|
|
32860
33144
|
var compactSpace = space.omit({ memberEmails: true });
|
|
32861
|
-
var task = external_exports.strictObject({ activityId:
|
|
32862
|
-
var pin = external_exports.strictObject({ entityId:
|
|
32863
|
-
var child = external_exports.strictObject({ entityId:
|
|
32864
|
-
var matchFields = { spaceIds: external_exports.array(
|
|
33145
|
+
var task = external_exports.strictObject({ activityId: id11, title: external_exports.string().optional(), shortId: external_exports.number().optional() });
|
|
33146
|
+
var pin = external_exports.strictObject({ entityId: id11, name: external_exports.string(), type: external_exports.enum(ENTITY_TYPE_VALUES), role: external_exports.string().optional(), displayOrder: external_exports.number().optional(), includeInAggregation: external_exports.boolean() });
|
|
33147
|
+
var child = external_exports.strictObject({ entityId: id11, name: external_exports.string(), displayName: external_exports.string(), parentNames: external_exports.array(external_exports.string()), parentDetails: external_exports.array(parentDetail), type: external_exports.enum(ENTITY_TYPE_VALUES) });
|
|
33148
|
+
var matchFields = { spaceIds: external_exports.array(id11), openTasks: external_exports.array(task), descriptionPlainText: external_exports.string().optional(), activityCount: external_exports.number(), activityCountPartial: external_exports.boolean().optional(), lastActivityAt: external_exports.number().optional() };
|
|
32865
33149
|
var entityReadFullList = external_exports.strictObject({ entities: external_exports.array(external_exports.strictObject({ entity: entityReadDocument, ...matchFields })), spaces: external_exports.record(external_exports.string(), space), openTasksPartial: external_exports.boolean().optional() });
|
|
32866
|
-
var entityReadFullSearch = external_exports.strictObject({ entities: external_exports.array(external_exports.strictObject({ entity: entityReadRichDocument, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId:
|
|
33150
|
+
var entityReadFullSearch = external_exports.strictObject({ entities: external_exports.array(external_exports.strictObject({ entity: entityReadRichDocument, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId: id11, name: external_exports.string() }).optional() })), spaces: external_exports.record(external_exports.string(), space) });
|
|
32867
33151
|
var entityReadFullDetail = external_exports.strictObject({ entity: entityReadRichDocument, pins: external_exports.array(pin), children: external_exports.array(child), childrenTruncated: external_exports.boolean(), aggregationMode: external_exports.enum(["includeDirectChildren", "directOnly"]), activities: external_exports.array(entityReadActivity), openTasks: external_exports.array(task), spaces: external_exports.array(space), descriptionPlainText: external_exports.string().optional() }).nullable();
|
|
32868
33152
|
var selectSpace = external_exports.object(space.shape);
|
|
32869
33153
|
var selectList = external_exports.object({ ...entityReadFullList.shape, entities: external_exports.array(external_exports.object({ entity: selectPublicEntityRead, ...matchFields })), spaces: external_exports.record(external_exports.string(), selectSpace) });
|
|
32870
33154
|
var selectRichEntity = external_exports.object({ ...selectPublicEntityRead.shape, displayName: external_exports.string(), parentNames: external_exports.array(external_exports.string()), parentDetails: external_exports.array(readParentDetail) });
|
|
32871
|
-
var selectSearch = external_exports.object({ ...entityReadFullSearch.shape, entities: external_exports.array(external_exports.object({ entity: selectRichEntity, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId:
|
|
33155
|
+
var selectSearch = external_exports.object({ ...entityReadFullSearch.shape, entities: external_exports.array(external_exports.object({ entity: selectRichEntity, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId: id11, name: external_exports.string() }).optional() })), spaces: external_exports.record(external_exports.string(), selectSpace) });
|
|
32872
33156
|
var selectDetail = external_exports.object({ ...entityReadFullDetail.unwrap().shape, entity: selectRichEntity, activities: external_exports.array(selectPublicActivityRead), spaces: external_exports.array(selectSpace) }).nullable();
|
|
32873
33157
|
var compactEntity = external_exports.strictObject(entityReadRichDocument.shape).pick({ _id: true, name: true, displayName: true, parentNames: true, parentDetails: true, type: true, descriptionPlainText: true, tags: true, aliases: true, lastActivityAt: true, fields: true }).partial({ displayName: true, parentNames: true, parentDetails: true });
|
|
32874
33158
|
var compactActivity = entityReadActivity.pick({ _id: true, shortId: true, title: true, type: true, contentPlainText: true, deadline: true, completed: true, tags: true, createdAt: true, updatedAt: true, spaceId: true });
|
|
32875
33159
|
var compactList = entityReadFullList.extend({ entities: external_exports.array(external_exports.strictObject({ entity: compactEntity, ...matchFields })), spaces: external_exports.record(external_exports.string(), compactSpace) });
|
|
32876
|
-
var compactSearch = entityReadFullSearch.extend({ entities: external_exports.array(external_exports.strictObject({ entity: compactEntity, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId:
|
|
33160
|
+
var compactSearch = entityReadFullSearch.extend({ entities: external_exports.array(external_exports.strictObject({ entity: compactEntity, ...matchFields, pins: external_exports.array(pin), matchedViaParent: external_exports.strictObject({ entityId: id11, name: external_exports.string() }).optional() })), spaces: external_exports.record(external_exports.string(), compactSpace) });
|
|
32877
33161
|
var compactDetail = entityReadFullDetail.unwrap().extend({ entity: compactEntity, activities: external_exports.array(compactActivity), spaces: external_exports.array(compactSpace) }).nullable();
|
|
32878
33162
|
var entityReadResults = {
|
|
32879
33163
|
searchEntities: external_exports.discriminatedUnion("projection", [entityReadFullSearch.extend({ projection: external_exports.literal("full") }), compactSearch.extend({ projection: external_exports.literal("compact") })]),
|
|
@@ -32883,14 +33167,14 @@ var entityReadResults = {
|
|
|
32883
33167
|
function parseEntityReadResult(operation, raw) {
|
|
32884
33168
|
switch (operation) {
|
|
32885
33169
|
case "searchEntities":
|
|
32886
|
-
return
|
|
33170
|
+
return checked2(entityReadResults.searchEntities, raw);
|
|
32887
33171
|
case "listEntities":
|
|
32888
|
-
return
|
|
33172
|
+
return checked2(entityReadResults.listEntities, raw);
|
|
32889
33173
|
case "getEntity":
|
|
32890
|
-
return
|
|
33174
|
+
return checked2(entityReadResults.getEntity, raw);
|
|
32891
33175
|
}
|
|
32892
33176
|
}
|
|
32893
|
-
function
|
|
33177
|
+
function checked2(schema, raw) {
|
|
32894
33178
|
return parseZodOperationResult("entityRead", schema, raw, "Invalid entity read result");
|
|
32895
33179
|
}
|
|
32896
33180
|
|
|
@@ -32914,14 +33198,6 @@ var relationshipUiInputs = {
|
|
|
32914
33198
|
reorderChildren: external_exports.strictObject({ targetEntityId: relationshipId, orderedSourceEntityIds: external_exports.array(relationshipId).max(RELATIONSHIP_LIMITS.rows) })
|
|
32915
33199
|
};
|
|
32916
33200
|
|
|
32917
|
-
// ../packages/shared/src/input-fields.ts
|
|
32918
|
-
function isInputRecord(value) {
|
|
32919
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
32920
|
-
}
|
|
32921
|
-
function optionalStringArray(value) {
|
|
32922
|
-
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : void 0;
|
|
32923
|
-
}
|
|
32924
|
-
|
|
32925
33201
|
// ../packages/shared/src/entity-creation.ts
|
|
32926
33202
|
var entityParentRole = relationshipRole.describe("Optional role of the new child at parentEntityId, stored on the atomic parent link and shown as `Parent \xB7 role` (for example Mandant). Same rule as the managePins role: whitespace is trimmed and collapsed, at most 80 characters, blank stores no role. Requires parentEntityId.");
|
|
32927
33203
|
function parentRoleLacksParent(value) {
|
|
@@ -32954,20 +33230,20 @@ var ENTITY_CREATE_INPUT_SCHEMA = {
|
|
|
32954
33230
|
function isEntityType(value) {
|
|
32955
33231
|
return typeof value === "string" && ENTITY_TYPE_VALUES.some((type) => type === value);
|
|
32956
33232
|
}
|
|
32957
|
-
var
|
|
33233
|
+
var invalid2 = (message3) => ({ ok: false, message: message3 });
|
|
32958
33234
|
function parseEntityCreateInput(args, name4 = "entities_create") {
|
|
32959
|
-
if (Object.hasOwn(args, "attributes")) return
|
|
33235
|
+
if (Object.hasOwn(args, "attributes")) return invalid2(LEGACY_ENTITY_ATTRIBUTES_ERROR);
|
|
32960
33236
|
if (args.parentEntityId !== void 0 && (typeof args.parentEntityId !== "string" || !args.parentEntityId.trim()))
|
|
32961
|
-
return
|
|
32962
|
-
if (args.exclusiveParent !== void 0 && typeof args.exclusiveParent !== "boolean") return
|
|
32963
|
-
if (args.allowNonExclusiveChildren !== void 0 && typeof args.allowNonExclusiveChildren !== "boolean") return
|
|
32964
|
-
if (args.parentRole !== void 0 && typeof args.parentRole !== "string") return
|
|
32965
|
-
if (typeof args.name !== "string" || !args.name.trim()) return
|
|
32966
|
-
if (args.type !== void 0 && !isEntityType(args.type)) return
|
|
33237
|
+
return invalid2("parentEntityId must be a non-empty string");
|
|
33238
|
+
if (args.exclusiveParent !== void 0 && typeof args.exclusiveParent !== "boolean") return invalid2("exclusiveParent must be a boolean");
|
|
33239
|
+
if (args.allowNonExclusiveChildren !== void 0 && typeof args.allowNonExclusiveChildren !== "boolean") return invalid2("allowNonExclusiveChildren must be a boolean");
|
|
33240
|
+
if (args.parentRole !== void 0 && typeof args.parentRole !== "string") return invalid2("parentRole must be a string");
|
|
33241
|
+
if (typeof args.name !== "string" || !args.name.trim()) return invalid2(`${name4} requires non-empty string name`);
|
|
33242
|
+
if (args.type !== void 0 && !isEntityType(args.type)) return invalid2(`${name4} type must be one of: ${ENTITY_TYPE_VALUES.join(", ")}`);
|
|
32967
33243
|
const tags2 = optionalStringArray(args.tags), aliases = optionalStringArray(args.aliases);
|
|
32968
33244
|
const description = typeof args.description === "string" ? args.description : void 0;
|
|
32969
33245
|
const fieldResult = fieldInputSchema.array().safeParse(args.fields);
|
|
32970
|
-
if (args.fields !== void 0 && !fieldResult.success) return
|
|
33246
|
+
if (args.fields !== void 0 && !fieldResult.success) return invalid2("fields must contain label, optional type, and value");
|
|
32971
33247
|
const fields4 = fieldResult.success ? fieldResult.data : void 0;
|
|
32972
33248
|
const spaceIds = optionalStringArray(args.spaceIds);
|
|
32973
33249
|
return { ok: true, value: {
|
|
@@ -32986,12 +33262,12 @@ function parseEntityCreateInput(args, name4 = "entities_create") {
|
|
|
32986
33262
|
} };
|
|
32987
33263
|
}
|
|
32988
33264
|
function parseEntityUpdateInput(args, name4 = "entities_update") {
|
|
32989
|
-
if (Object.hasOwn(args, "attributes")) return
|
|
32990
|
-
if (args.allowNonExclusiveChildren !== void 0 && typeof args.allowNonExclusiveChildren !== "boolean") return
|
|
32991
|
-
if (typeof args.entityId !== "string") return
|
|
33265
|
+
if (Object.hasOwn(args, "attributes")) return invalid2(LEGACY_ENTITY_ATTRIBUTES_ERROR);
|
|
33266
|
+
if (args.allowNonExclusiveChildren !== void 0 && typeof args.allowNonExclusiveChildren !== "boolean") return invalid2("allowNonExclusiveChildren must be a boolean");
|
|
33267
|
+
if (typeof args.entityId !== "string") return invalid2(`${name4} requires string entityId`);
|
|
32992
33268
|
const tags2 = optionalStringArray(args.tags), aliases = optionalStringArray(args.aliases);
|
|
32993
33269
|
const fieldResult = fieldInputSchema.array().safeParse(args.fields);
|
|
32994
|
-
if (args.fields !== void 0 && !fieldResult.success) return
|
|
33270
|
+
if (args.fields !== void 0 && !fieldResult.success) return invalid2("fields must contain label, optional type, and value");
|
|
32995
33271
|
const fields4 = fieldResult.success ? fieldResult.data : void 0;
|
|
32996
33272
|
return { ok: true, value: {
|
|
32997
33273
|
entityId: args.entityId,
|
|
@@ -33005,31 +33281,31 @@ function parseEntityUpdateInput(args, name4 = "entities_update") {
|
|
|
33005
33281
|
}
|
|
33006
33282
|
|
|
33007
33283
|
// ../packages/shared/src/entity-write-operations.ts
|
|
33008
|
-
var
|
|
33284
|
+
var id12 = external_exports.string().min(1).max(128).refine((value) => value.trim() === value, "Copy IDs unchanged");
|
|
33009
33285
|
var name2 = external_exports.string().trim().min(1);
|
|
33010
33286
|
var fields = { allowNonExclusiveChildren: external_exports.boolean().optional(), name: name2.optional(), description: external_exports.string().optional(), tags: external_exports.array(external_exports.string()).optional(), fields: external_exports.array(fieldInputSchema).max(MAX_ENTITY_FIELD_VALUES).optional(), attributes: external_exports.unknown().optional(), aliases: external_exports.array(external_exports.string()).optional() };
|
|
33011
33287
|
var create = external_exports.strictObject({
|
|
33012
33288
|
...fields,
|
|
33013
33289
|
name: name2,
|
|
33014
33290
|
type: external_exports.enum(ENTITY_TYPE_VALUES).default("person"),
|
|
33015
|
-
spaceId:
|
|
33016
|
-
spaceIds: external_exports.array(
|
|
33017
|
-
parentEntityId:
|
|
33291
|
+
spaceId: id12.optional(),
|
|
33292
|
+
spaceIds: external_exports.array(id12).min(1).optional(),
|
|
33293
|
+
parentEntityId: id12.optional(),
|
|
33018
33294
|
exclusiveParent: external_exports.boolean().optional(),
|
|
33019
33295
|
parentRole: entityParentRole.optional()
|
|
33020
33296
|
}).refine((value) => value.spaceId !== void 0 || value.spaceIds !== void 0, { path: ["spaceId"], message: "Select spaceId or nonempty spaceIds" }).refine((value) => !parentRoleLacksParent(value), { path: ["parentRole"], message: "parentRole requires parentEntityId" });
|
|
33021
33297
|
var entityWriteInputs = {
|
|
33022
33298
|
createEntity: create,
|
|
33023
|
-
updateEntity: external_exports.strictObject({ entityId:
|
|
33024
|
-
updateEntityName: external_exports.strictObject({ entityId:
|
|
33025
|
-
duplicateEntity: external_exports.strictObject({ entityId:
|
|
33026
|
-
addFieldValue: external_exports.strictObject({ entityId:
|
|
33027
|
-
updateFieldValue: external_exports.strictObject({ valueId:
|
|
33028
|
-
removeFieldValue: external_exports.strictObject({ valueId:
|
|
33029
|
-
archiveEntity: external_exports.strictObject({ entityId:
|
|
33030
|
-
restoreEntity: external_exports.strictObject({ entityId:
|
|
33299
|
+
updateEntity: external_exports.strictObject({ entityId: id12, spaceId: id12.optional(), ...fields }),
|
|
33300
|
+
updateEntityName: external_exports.strictObject({ entityId: id12, spaceId: id12.optional(), name: name2 }),
|
|
33301
|
+
duplicateEntity: external_exports.strictObject({ entityId: id12, spaceId: id12, name: name2.optional(), includeExclusiveChildren: external_exports.boolean().default(false) }),
|
|
33302
|
+
addFieldValue: external_exports.strictObject({ entityId: id12, fieldId: id12.optional(), label: fieldLabelSchema.optional(), type: fieldTypeSchema.optional(), value: external_exports.string() }).refine((value) => !!value.fieldId !== !!value.label && (!value.fieldId || value.type === void 0), { message: "Select fieldId, or label with optional type" }),
|
|
33303
|
+
updateFieldValue: external_exports.strictObject({ valueId: id12, value: external_exports.string() }),
|
|
33304
|
+
removeFieldValue: external_exports.strictObject({ valueId: id12 }),
|
|
33305
|
+
archiveEntity: external_exports.strictObject({ entityId: id12 }),
|
|
33306
|
+
restoreEntity: external_exports.strictObject({ entityId: id12, grantMissingParentAccess: external_exports.boolean().optional(), parentSpaceGrantFingerprint: external_exports.string().trim().min(1).optional() })
|
|
33031
33307
|
};
|
|
33032
|
-
function
|
|
33308
|
+
function parserMismatch2(operation) {
|
|
33033
33309
|
throw new OperationInputError(operation, [{ path: [], reason: "custom" }]);
|
|
33034
33310
|
}
|
|
33035
33311
|
function parseEntityWriteRequest(operation, raw) {
|
|
@@ -33038,17 +33314,17 @@ function parseEntityWriteRequest(operation, raw) {
|
|
|
33038
33314
|
case "createEntity": {
|
|
33039
33315
|
const input2 = parseOperationInput(operation, entityWriteInputs.createEntity, raw);
|
|
33040
33316
|
const parsed = parseEntityCreateInput(input2, operation);
|
|
33041
|
-
if (!parsed.ok) return
|
|
33317
|
+
if (!parsed.ok) return parserMismatch2(operation);
|
|
33042
33318
|
return { operation, input: { ...input2, name: parsed.value.name } };
|
|
33043
33319
|
}
|
|
33044
33320
|
case "updateEntity": {
|
|
33045
33321
|
const input2 = parseOperationInput(operation, entityWriteInputs.updateEntity, raw);
|
|
33046
|
-
if (!parseEntityUpdateInput(input2, operation).ok) return
|
|
33322
|
+
if (!parseEntityUpdateInput(input2, operation).ok) return parserMismatch2(operation);
|
|
33047
33323
|
return { operation, input: input2 };
|
|
33048
33324
|
}
|
|
33049
33325
|
case "updateEntityName": {
|
|
33050
33326
|
const input2 = parseOperationInput(operation, entityWriteInputs.updateEntityName, raw);
|
|
33051
|
-
if (!parseEntityUpdateInput(input2, operation).ok) return
|
|
33327
|
+
if (!parseEntityUpdateInput(input2, operation).ok) return parserMismatch2(operation);
|
|
33052
33328
|
return { operation, input: input2 };
|
|
33053
33329
|
}
|
|
33054
33330
|
case "addFieldValue":
|
|
@@ -33109,39 +33385,40 @@ var publicCliEntityWriteResults = {
|
|
|
33109
33385
|
restoreEntity: success2.extend({ entityId })
|
|
33110
33386
|
};
|
|
33111
33387
|
function parsePublicCliEntityWriteResult(operation, raw) {
|
|
33112
|
-
return
|
|
33388
|
+
return checked3(publicCliEntityWriteResults[operation], raw);
|
|
33113
33389
|
}
|
|
33114
33390
|
function parseEntityWriteResult(operation, raw) {
|
|
33115
|
-
return
|
|
33391
|
+
return checked3(entityWriteResults[operation], raw);
|
|
33116
33392
|
}
|
|
33117
|
-
function
|
|
33393
|
+
function checked3(schema, raw) {
|
|
33118
33394
|
return parseZodOperationResult("entityWrite", schema, raw, "Invalid entity write result");
|
|
33119
33395
|
}
|
|
33120
33396
|
function projectEntityWriteResult(operation, raw) {
|
|
33121
33397
|
switch (operation) {
|
|
33122
33398
|
case "createEntity":
|
|
33123
|
-
return
|
|
33399
|
+
return checked3(entityWriteResults.createEntity, { entityId: checked3(entityId, raw) });
|
|
33124
33400
|
case "duplicateEntity":
|
|
33125
|
-
return
|
|
33401
|
+
return checked3(entityWriteResults.duplicateEntity, raw);
|
|
33126
33402
|
case "addFieldValue":
|
|
33127
|
-
return
|
|
33403
|
+
return checked3(entityWriteResults.addFieldValue, raw);
|
|
33128
33404
|
default:
|
|
33129
33405
|
if (raw !== null) throw new OperationResultError(operation, "Invalid entity write result");
|
|
33130
|
-
return
|
|
33406
|
+
return checked3(success2, { success: true });
|
|
33131
33407
|
}
|
|
33132
33408
|
}
|
|
33133
33409
|
|
|
33134
33410
|
// ../packages/shared/src/activity-read-operation-results.ts
|
|
33135
|
-
var
|
|
33411
|
+
var id13 = external_exports.string().min(1);
|
|
33136
33412
|
var publicActivityRecordDto = publicActivityReadDto.extend({ deletedAt: external_exports.number().optional() });
|
|
33137
33413
|
var selectActivity = selectPublicActivityRead.extend({ deletedAt: external_exports.number().optional(), attachments: external_exports.array(external_exports.object(publicActivityReadDto.shape.attachments.unwrap().element.shape)).optional() });
|
|
33138
|
-
var user = external_exports.strictObject({ _id:
|
|
33139
|
-
var agent = external_exports.strictObject({ agentId:
|
|
33414
|
+
var user = external_exports.strictObject({ _id: id13, name: external_exports.string().optional(), email: external_exports.string().optional(), avatarInitials: external_exports.string().optional(), image: external_exports.string().optional() });
|
|
33415
|
+
var agent = external_exports.strictObject({ agentId: id13, icon: external_exports.union([external_exports.enum([.../* @__PURE__ */ new Set([...entityCustomIconIds, ...activityCustomIconIds, ...legacyCustomIconIds])]), external_exports.string().max(AGENT_ICON_IMAGE_MAX).startsWith("data:image/png;base64,").refine(isAgentIconImage)]).optional(), name: external_exports.string(), color: external_exports.string(), archived: external_exports.boolean() });
|
|
33140
33416
|
var actorFields = { createdByPersonalAgent: external_exports.boolean().optional(), createdByAgent: agent.nullable().optional(), updatedByAgent: agent.nullable().optional(), createdByAgentCreatorUser: user.omit({ email: true, image: true }).extend({ avatarInitials: external_exports.string() }).nullable().optional() };
|
|
33141
|
-
var attachment = external_exports.strictObject({ attachmentId:
|
|
33142
|
-
var agenda = external_exports.strictObject({ _id:
|
|
33143
|
-
var message = external_exports.strictObject({ _id:
|
|
33417
|
+
var attachment = external_exports.strictObject({ attachmentId: id13, storageId: id13, name: external_exports.string(), mimeType: external_exports.string(), sizeBytes: external_exports.number(), url: external_exports.string().nullable() });
|
|
33418
|
+
var agenda = external_exports.strictObject({ _id: id13, parentPointId: id13.optional(), orderKey: external_exports.string(), title: external_exports.string(), titleMarkdown: external_exports.string(), contentMarkdown: external_exports.string(), contentVersion: external_exports.number().nullable(), updatedAt: external_exports.number() });
|
|
33419
|
+
var message = external_exports.strictObject({ _id: id13, activityId: id13, parentMessageId: id13.optional(), depth: external_exports.number().optional(), createdBy: id13, createdByAgentId: id13.optional(), updatedBy: id13.optional(), updatedByAgentId: id13.optional(), createdAt: external_exports.number(), updatedAt: external_exports.number(), contentPlainText: external_exports.string(), createdByUser: user.nullable(), createdByAgent: agent.nullable().optional(), updatedByAgent: agent.nullable().optional() });
|
|
33144
33420
|
var publicActivityDetailDto = publicActivityRecordDto.extend({
|
|
33421
|
+
entityIds: external_exports.array(id13).optional(),
|
|
33145
33422
|
attachments: external_exports.array(attachment).optional(),
|
|
33146
33423
|
createdByUser: user.nullable(),
|
|
33147
33424
|
...actorFields,
|
|
@@ -33172,21 +33449,22 @@ var selectPage = external_exports.object({ activities: external_exports.array(se
|
|
|
33172
33449
|
var fullPage = activityReadFullPage.extend({ projection: external_exports.literal("full") });
|
|
33173
33450
|
var compactPage = activityReadFullPage.extend({ activities: external_exports.array(compactActivity2), projection: external_exports.literal("compact") });
|
|
33174
33451
|
var pages = external_exports.discriminatedUnion("projection", [fullPage, compactPage]);
|
|
33452
|
+
var taskLookupTombstone = external_exports.strictObject({ projection: external_exports.literal("tombstone"), _id: id13, spaceId: id13, type: external_exports.literal("task"), completed: external_exports.boolean(), deletedAt: external_exports.number() });
|
|
33175
33453
|
var activityReadResults = {
|
|
33176
|
-
getActivity: external_exports.union([publicActivityDetailDto.extend({ projection: external_exports.literal("full") }), compactDetail2.extend({ projection: external_exports.literal("compact") }), external_exports.null()]),
|
|
33454
|
+
getActivity: external_exports.union([taskLookupTombstone, publicActivityDetailDto.extend({ projection: external_exports.literal("full") }), compactDetail2.extend({ projection: external_exports.literal("compact") }), external_exports.null()]),
|
|
33177
33455
|
listActivities: pages,
|
|
33178
33456
|
searchActivities: external_exports.discriminatedUnion("projection", [external_exports.strictObject({ activities: external_exports.array(publicActivityRecordDto), projection: external_exports.literal("full") }), external_exports.strictObject({ activities: external_exports.array(compactActivity2), projection: external_exports.literal("compact") })]),
|
|
33179
33457
|
listRecentActivities: pages
|
|
33180
33458
|
};
|
|
33181
33459
|
function parseActivityReadResult(name4, raw) {
|
|
33182
33460
|
try {
|
|
33183
|
-
return
|
|
33461
|
+
return checked4(activityReadResults[name4], raw);
|
|
33184
33462
|
} catch (error62) {
|
|
33185
33463
|
if (error62 instanceof OperationResultError) throw new OperationResultError(name4);
|
|
33186
33464
|
throw error62;
|
|
33187
33465
|
}
|
|
33188
33466
|
}
|
|
33189
|
-
function
|
|
33467
|
+
function checked4(schema, raw) {
|
|
33190
33468
|
return parseZodOperationResult("activityRead", schema, raw, "Invalid activity read result");
|
|
33191
33469
|
}
|
|
33192
33470
|
|
|
@@ -33617,8 +33895,8 @@ function parseAgendaCreateResponse(raw) {
|
|
|
33617
33895
|
}
|
|
33618
33896
|
|
|
33619
33897
|
// ../packages/shared/src/agenda-operations.ts
|
|
33620
|
-
var
|
|
33621
|
-
var activityId =
|
|
33898
|
+
var id14 = external_exports.string().min(1).max(128).refine((value) => value.trim() === value, "Copy IDs unchanged");
|
|
33899
|
+
var activityId = id14.describe("Existing activity ID of any type; the legacy field name remains compatible.");
|
|
33622
33900
|
var title = external_exports.string().trim().min(1);
|
|
33623
33901
|
var version3 = external_exports.number().int().nonnegative().nullable();
|
|
33624
33902
|
var agendaInputs = {
|
|
@@ -33626,17 +33904,17 @@ var agendaInputs = {
|
|
|
33626
33904
|
meetingActivityId: activityId,
|
|
33627
33905
|
title: title.describe("Agenda title. Entity mentions use [entity](ente://entity/<entityId>)."),
|
|
33628
33906
|
contentMarkdown: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION).optional(),
|
|
33629
|
-
parentPointId:
|
|
33630
|
-
afterPointId:
|
|
33907
|
+
parentPointId: id14.optional(),
|
|
33908
|
+
afterPointId: id14.optional()
|
|
33631
33909
|
}),
|
|
33632
33910
|
getMeetingAgenda: external_exports.strictObject({ meetingActivityId: activityId }),
|
|
33633
33911
|
updateAgendaPointTitle: external_exports.strictObject({
|
|
33634
|
-
agendaPointId:
|
|
33912
|
+
agendaPointId: id14,
|
|
33635
33913
|
title,
|
|
33636
33914
|
expectedUpdatedAt: external_exports.number().nonnegative()
|
|
33637
33915
|
}),
|
|
33638
33916
|
replaceAgendaPointContent: external_exports.strictObject({
|
|
33639
|
-
agendaPointId:
|
|
33917
|
+
agendaPointId: id14,
|
|
33640
33918
|
contentMarkdown: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION),
|
|
33641
33919
|
expectedContentVersion: version3
|
|
33642
33920
|
}),
|
|
@@ -33649,7 +33927,7 @@ var agendaAliases = {
|
|
|
33649
33927
|
agenda_points_replace_content: "replaceAgendaPointContent",
|
|
33650
33928
|
meeting_tasks_search: "searchMeetingTasks"
|
|
33651
33929
|
};
|
|
33652
|
-
var
|
|
33930
|
+
var descriptions3 = {
|
|
33653
33931
|
createAgendaPoint: "Create a titled agenda point with optional Markdown on an existing activity of any type. Prefer agenda points for structured content unless the user's prompt requests another format.",
|
|
33654
33932
|
getMeetingAgenda: "Read the ordered agenda of an existing activity of any type, including nested point IDs, plain and Markdown titles, markdown content, versions and timestamps. Read before updating a point.",
|
|
33655
33933
|
updateAgendaPointTitle: "Update a point title when expectedUpdatedAt still matches. A conflict preserves the human edit; read the agenda again before retrying.",
|
|
@@ -33665,7 +33943,7 @@ function buildAgendaDefinition(name4) {
|
|
|
33665
33943
|
name: name4,
|
|
33666
33944
|
aliases: operationAliases(agendaAliases, name4),
|
|
33667
33945
|
actor: "agent",
|
|
33668
|
-
description:
|
|
33946
|
+
description: descriptions3[name4],
|
|
33669
33947
|
inputSchema: {
|
|
33670
33948
|
type: "object",
|
|
33671
33949
|
properties: schema.properties ?? {},
|
|
@@ -33689,8 +33967,8 @@ function buildAgendaDefinition(name4) {
|
|
|
33689
33967
|
limits: name4 === "searchMeetingTasks" ? { results: AGENDA_TASK_RESULT_LIMIT, ownersPerTask: AGENDA_TASK_OWNER_LIMIT } : null
|
|
33690
33968
|
};
|
|
33691
33969
|
}
|
|
33692
|
-
var
|
|
33693
|
-
var agendaCatalog = [...
|
|
33970
|
+
var definitions2 = new Map(Object.keys(agendaInputs).filter(isAgendaOperationName).map((name4) => [name4, buildAgendaDefinition(name4)]));
|
|
33971
|
+
var agendaCatalog = [...definitions2.values()];
|
|
33694
33972
|
|
|
33695
33973
|
// core/transport.ts
|
|
33696
33974
|
var RestClient = class {
|
|
@@ -33704,6 +33982,9 @@ var RestClient = class {
|
|
|
33704
33982
|
this.apiKey = opts.apiKey;
|
|
33705
33983
|
this.timeoutMs = opts.timeoutMs ?? 15e3;
|
|
33706
33984
|
}
|
|
33985
|
+
sendJson(method, path9, body) {
|
|
33986
|
+
return this.request(method, path9, body);
|
|
33987
|
+
}
|
|
33707
33988
|
get(path9, params, opts) {
|
|
33708
33989
|
return this.request("GET", path9, void 0, params, opts);
|
|
33709
33990
|
}
|
|
@@ -34865,6 +35146,13 @@ var EnteClient = class _EnteClient {
|
|
|
34865
35146
|
const request = parseEntityWriteRequest(operation, input2);
|
|
34866
35147
|
return { data: parseEntityWriteResult(operation, await this.operationData(operation, request.input)) };
|
|
34867
35148
|
}
|
|
35149
|
+
async activityWrite(operation, input2) {
|
|
35150
|
+
const request = parseActivityWriteRequest(operation, input2);
|
|
35151
|
+
const binding = activityWriteRestBindings.find((item) => item.operation === operation);
|
|
35152
|
+
if (!binding) throw new Error("Operation has no REST binding");
|
|
35153
|
+
const response = await this.rest.sendJson(binding.method, binding.path, request.input);
|
|
35154
|
+
return { data: parseZodOperationResult(operation, activityWriteResults[operation], response.data) };
|
|
35155
|
+
}
|
|
34868
35156
|
async activityRead(operation, input2) {
|
|
34869
35157
|
const request = parseActivityReadRequest(operation, input2);
|
|
34870
35158
|
return { data: parseActivityReadResult(operation, await this.operationData(operation, request.input)) };
|
|
@@ -41224,192 +41512,28 @@ var AUTH_COMMANDS = [
|
|
|
41224
41512
|
];
|
|
41225
41513
|
|
|
41226
41514
|
// ../packages/shared/src/relationship-operation-results.ts
|
|
41227
|
-
var
|
|
41228
|
-
var relationshipSummary = external_exports.strictObject({ entityId:
|
|
41229
|
-
var relationshipAddReceipt = external_exports.strictObject({ action: external_exports.literal("add"), pinId:
|
|
41515
|
+
var id15 = external_exports.string().min(1);
|
|
41516
|
+
var relationshipSummary = external_exports.strictObject({ entityId: id15, name: external_exports.string(), type: external_exports.enum(ENTITY_TYPE_VALUES), role: external_exports.string().max(RELATIONSHIP_LIMITS.role).optional(), displayOrder: external_exports.number().finite().optional(), includeInAggregation: external_exports.boolean() });
|
|
41517
|
+
var relationshipAddReceipt = external_exports.strictObject({ action: external_exports.literal("add"), pinId: id15, alreadyExists: external_exports.boolean() });
|
|
41230
41518
|
var relationshipRemoveReceipt = external_exports.strictObject({ action: external_exports.literal("remove"), success: external_exports.literal(true) });
|
|
41231
41519
|
var relationshipResults = { listPins: external_exports.array(relationshipSummary).max(RELATIONSHIP_LIMITS.rows), managePins: external_exports.discriminatedUnion("action", [relationshipAddReceipt, relationshipRemoveReceipt]) };
|
|
41232
41520
|
function checkRelationshipResult(schema, raw) {
|
|
41233
41521
|
return parseZodOperationResult("relationship", schema, raw, "Invalid relationship result");
|
|
41234
41522
|
}
|
|
41235
|
-
var relationshipCliSummary = external_exports.strictObject({ entityId:
|
|
41523
|
+
var relationshipCliSummary = external_exports.strictObject({ entityId: id15, name: external_exports.string().optional(), type: external_exports.enum(ENTITY_TYPE_VALUES).optional(), role: external_exports.string().optional() });
|
|
41236
41524
|
var relationshipPublicListRow = external_exports.strictObject({
|
|
41237
|
-
_id:
|
|
41238
|
-
targetEntityId:
|
|
41525
|
+
_id: id15,
|
|
41526
|
+
targetEntityId: id15,
|
|
41239
41527
|
role: external_exports.string().max(RELATIONSHIP_LIMITS.role).optional(),
|
|
41240
41528
|
displayOrder: external_exports.number().finite().optional(),
|
|
41241
41529
|
includeInAggregation: external_exports.boolean(),
|
|
41242
|
-
targetEntity: external_exports.strictObject({ _id:
|
|
41530
|
+
targetEntity: external_exports.strictObject({ _id: id15, name: external_exports.string(), type: external_exports.enum(ENTITY_TYPE_VALUES), customIcon: entityReadFields.customIcon, customIconColor: entityReadFields.customIconColor, displayName: external_exports.string(), parentNames: external_exports.array(external_exports.string()), parentDetails: external_exports.array(readParentDetail) }).nullable()
|
|
41243
41531
|
});
|
|
41244
41532
|
var relationshipPublicList = external_exports.array(relationshipPublicListRow).max(RELATIONSHIP_LIMITS.rows);
|
|
41245
41533
|
function projectRelationshipCliList(raw) {
|
|
41246
41534
|
return checkRelationshipResult(relationshipPublicList, raw).map((row) => checkRelationshipResult(relationshipCliSummary, { entityId: row.targetEntityId, name: row.targetEntity?.name, type: row.targetEntity?.type, role: row.role }));
|
|
41247
41535
|
}
|
|
41248
41536
|
|
|
41249
|
-
// ../packages/shared/src/activity-operations.ts
|
|
41250
|
-
function isBoundedAgentIds(value) {
|
|
41251
|
-
return Array.isArray(value) && value.length <= MAX_ACTIVITY_AGENT_ASSIGNEES && value.every((id21) => typeof id21 === "string" && id21.length > 0);
|
|
41252
|
-
}
|
|
41253
|
-
function optionalBoolean(value) {
|
|
41254
|
-
return typeof value === "boolean" ? value : void 0;
|
|
41255
|
-
}
|
|
41256
|
-
function isActivityType(value) {
|
|
41257
|
-
return typeof value === "string" && ACTIVITY_TYPE_VALUES.some((type) => type === value);
|
|
41258
|
-
}
|
|
41259
|
-
function stringAttributes(value) {
|
|
41260
|
-
const result = {};
|
|
41261
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
41262
|
-
if (typeof entry !== "string") return void 0;
|
|
41263
|
-
result[key] = entry;
|
|
41264
|
-
}
|
|
41265
|
-
return result;
|
|
41266
|
-
}
|
|
41267
|
-
function updateAttributes(value) {
|
|
41268
|
-
const result = {};
|
|
41269
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
41270
|
-
if (typeof entry !== "string" && entry !== null) return void 0;
|
|
41271
|
-
result[key] = entry;
|
|
41272
|
-
}
|
|
41273
|
-
return result;
|
|
41274
|
-
}
|
|
41275
|
-
var invalid2 = (message3) => ({ ok: false, message: message3 });
|
|
41276
|
-
function parseActivityCreateInput(args, name4 = "activities_create") {
|
|
41277
|
-
if ("createdAt" in args) return invalid2(`${name4} createdAt is no longer accepted; use sourceCreatedAt.`);
|
|
41278
|
-
if (args.sourceCreatedAt !== void 0 && !isSourceCreatedAtInput(args.sourceCreatedAt))
|
|
41279
|
-
return invalid2(`${name4} sourceCreatedAt must be an object: { date: "YYYY-MM-DD", time?: "HH:mm" | null, timezone?: string }`);
|
|
41280
|
-
const entityIds = optionalStringArray(args.entityIds);
|
|
41281
|
-
if (!entityIds?.length) return invalid2(`${name4} requires entityIds to be a non-empty string array`);
|
|
41282
|
-
if (!isActivityType(args.type)) return invalid2(`${name4} requires type to be one of: ${ACTIVITY_TYPE_VALUES.join(", ")}`);
|
|
41283
|
-
if (args.deadline !== void 0 && !isDeadlineInput(args.deadline))
|
|
41284
|
-
return invalid2(`${name4} deadline must be a readable deadline object or number`);
|
|
41285
|
-
if (args.agentAssigneeIds !== void 0 && !isBoundedAgentIds(args.agentAssigneeIds))
|
|
41286
|
-
return invalid2(`${name4} agentAssigneeIds must be an array of at most ${MAX_ACTIVITY_AGENT_ASSIGNEES} non-empty IDs`);
|
|
41287
|
-
const attributes2 = isInputRecord(args.attributes) ? stringAttributes(args.attributes) : void 0;
|
|
41288
|
-
if (args.attributes === null || isInputRecord(args.attributes) && attributes2 === void 0)
|
|
41289
|
-
return invalid2(`${name4} attributes must contain string values`);
|
|
41290
|
-
return { ok: true, value: {
|
|
41291
|
-
entityIds,
|
|
41292
|
-
type: args.type,
|
|
41293
|
-
title: typeof args.title === "string" ? args.title : void 0,
|
|
41294
|
-
content: typeof args.content === "string" ? args.content : typeof args.contentPlainText === "string" ? args.contentPlainText : void 0,
|
|
41295
|
-
contentPlainText: typeof args.contentPlainText === "string" ? args.contentPlainText : void 0,
|
|
41296
|
-
spaceId: typeof args.spaceId === "string" ? args.spaceId : void 0,
|
|
41297
|
-
deadline: isDeadlineInput(args.deadline) ? args.deadline : void 0,
|
|
41298
|
-
completed: optionalBoolean(args.completed),
|
|
41299
|
-
attributes: attributes2,
|
|
41300
|
-
sourceCreatedAt: isSourceCreatedAtInput(args.sourceCreatedAt) ? args.sourceCreatedAt : void 0,
|
|
41301
|
-
tags: optionalStringArray(args.tags),
|
|
41302
|
-
assigneeIds: optionalStringArray(args.assigneeIds),
|
|
41303
|
-
agentAssigneeIds: isBoundedAgentIds(args.agentAssigneeIds) ? args.agentAssigneeIds : void 0,
|
|
41304
|
-
assigneeEmails: optionalStringArray(args.assigneeEmails),
|
|
41305
|
-
autoLinkPersonalSpace: optionalBoolean(args.autoLinkPersonalSpace)
|
|
41306
|
-
} };
|
|
41307
|
-
}
|
|
41308
|
-
function parseActivityUpdateInput(args, name4 = "activities_update") {
|
|
41309
|
-
if (typeof args.activityId !== "string") return invalid2(`${name4} requires string activityId`);
|
|
41310
|
-
if ("deadline" in args && !isNullableDeadlineInput(args.deadline))
|
|
41311
|
-
return invalid2(`${name4} deadline must be a readable deadline object, number, or null`);
|
|
41312
|
-
if (args.type !== void 0 && !isActivityType(args.type))
|
|
41313
|
-
return invalid2(`${name4} type must be one of: ${ACTIVITY_TYPE_VALUES.join(", ")}`);
|
|
41314
|
-
const entityIds = optionalStringArray(args.entityIds);
|
|
41315
|
-
if (args.entityIds !== void 0 && !entityIds?.length) return invalid2(`${name4} entityIds must be a non-empty string array`);
|
|
41316
|
-
if (args.attributes !== void 0 && !isInputRecord(args.attributes)) return invalid2(`${name4} attributes must be an object`);
|
|
41317
|
-
const attributes2 = isInputRecord(args.attributes) ? updateAttributes(args.attributes) : void 0;
|
|
41318
|
-
if (isInputRecord(args.attributes) && attributes2 === void 0) return invalid2(`${name4} attributes must contain string or null values`);
|
|
41319
|
-
for (const key of ["assigneeIds", "assigneeEmails"])
|
|
41320
|
-
if (args[key] !== void 0 && !optionalStringArray(args[key])) return invalid2(`${name4} ${key} must be an array of strings`);
|
|
41321
|
-
if (args.agentAssigneeIds !== void 0 && !isBoundedAgentIds(args.agentAssigneeIds))
|
|
41322
|
-
return invalid2(`${name4} agentAssigneeIds must be an array of at most ${MAX_ACTIVITY_AGENT_ASSIGNEES} non-empty IDs`);
|
|
41323
|
-
return { ok: true, value: {
|
|
41324
|
-
activityId: args.activityId,
|
|
41325
|
-
title: typeof args.title === "string" ? args.title : void 0,
|
|
41326
|
-
content: typeof args.content === "string" ? args.content : void 0,
|
|
41327
|
-
completed: optionalBoolean(args.completed),
|
|
41328
|
-
deadline: isNullableDeadlineInput(args.deadline) ? args.deadline : void 0,
|
|
41329
|
-
entityIds,
|
|
41330
|
-
type: isActivityType(args.type) ? args.type : void 0,
|
|
41331
|
-
attributes: attributes2,
|
|
41332
|
-
assigneeIds: optionalStringArray(args.assigneeIds),
|
|
41333
|
-
assigneeEmails: optionalStringArray(args.assigneeEmails),
|
|
41334
|
-
agentAssigneeIds: isBoundedAgentIds(args.agentAssigneeIds) ? args.agentAssigneeIds : void 0
|
|
41335
|
-
} };
|
|
41336
|
-
}
|
|
41337
|
-
|
|
41338
|
-
// ../packages/shared/src/activity-write-operations.ts
|
|
41339
|
-
var ACTIVITY_WRITE_LIMITS = { wireArray: 8192, agentAssignees: MAX_ACTIVITY_AGENT_ASSIGNEES };
|
|
41340
|
-
var id14 = external_exports.string().min(1).max(128).refine((value) => value.trim() === value, "Copy IDs unchanged");
|
|
41341
|
-
var ids = external_exports.array(id14).max(ACTIVITY_WRITE_LIMITS.wireArray);
|
|
41342
|
-
var strings = external_exports.array(external_exports.string()).max(ACTIVITY_WRITE_LIMITS.wireArray);
|
|
41343
|
-
var readableActivityDate = external_exports.strictObject({ date: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/), time: external_exports.string().regex(/^\d{2}:\d{2}$/).nullable().optional(), timezone: external_exports.string().optional() }).refine(validDate, "Invalid readable date (calendar and timezone checked at runtime)");
|
|
41344
|
-
function validDate(value) {
|
|
41345
|
-
try {
|
|
41346
|
-
readableDateTimeToEpochMs(value, "date");
|
|
41347
|
-
return true;
|
|
41348
|
-
} catch {
|
|
41349
|
-
return false;
|
|
41350
|
-
}
|
|
41351
|
-
}
|
|
41352
|
-
var activityWriteDeadline = external_exports.union([external_exports.number(), readableActivityDate]);
|
|
41353
|
-
var nullableDeadline = activityWriteDeadline.nullable();
|
|
41354
|
-
var assignees = { assigneeIds: ids.optional(), assigneeEmails: strings.optional(), agentAssigneeIds: ids.max(MAX_ACTIVITY_AGENT_ASSIGNEES).optional() };
|
|
41355
|
-
var stringAttributes2 = external_exports.record(attributeKey, external_exports.string());
|
|
41356
|
-
var patchAttributes = attributeStringPatch;
|
|
41357
|
-
var updateFields = { activityId: id14, title: external_exports.string().optional(), content: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION).optional(), deadline: nullableDeadline.optional(), completed: external_exports.boolean().optional(), entityIds: ids.min(1).optional(), type: external_exports.enum(ACTIVITY_TYPE_VALUES).optional(), attributes: patchAttributes.optional(), ...assignees };
|
|
41358
|
-
var assignment = external_exports.strictObject({ activityId: id14, action: external_exports.enum(["replace", "add", "remove", "clear"]), assigneeIds: ids.optional(), assigneeEmails: strings.optional(), agentAssigneeIds: ids.describe("At most 20 IDs for replace. Add/remove/clear retain the installed bounded wire array; add deduplicates before enforcing at most 20 assigned agents in the resulting task. Assignment grants no access.").optional() }).refine((value) => value.action !== "replace" || value.agentAssigneeIds === void 0 || value.agentAssigneeIds.length <= MAX_ACTIVITY_AGENT_ASSIGNEES, { path: ["agentAssigneeIds"], message: "Too many replacement agent assignees" });
|
|
41359
|
-
var attributes = external_exports.strictObject({ activityId: id14, action: external_exports.enum(["set", "remove", "replace", "clear"]), attributes: stringAttributes2.optional(), keys: strings.optional() }).refine((value) => value.action !== "set" || value.attributes !== void 0 && Object.keys(value.attributes).length > 0, { path: ["attributes"], message: "set requires attributes" }).refine((value) => value.action !== "remove" || value.keys !== void 0 && value.keys.length > 0, { path: ["keys"], message: "remove requires keys" });
|
|
41360
|
-
var activityWriteInputs = {
|
|
41361
|
-
createActivity: external_exports.strictObject({ spaceId: id14.describe("Explicit destination space ID; choose it before creating this activity."), entityIds: ids.min(1), type: external_exports.enum(ACTIVITY_TYPE_VALUES), title: external_exports.string().optional(), content: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION).optional(), deadline: activityWriteDeadline.optional(), completed: external_exports.boolean().optional(), attributes: stringAttributes2.optional(), sourceCreatedAt: readableActivityDate.describe(ACTIVITY_CREATE_SOURCE_CREATED_AT_DESCRIPTION).optional(), tags: strings.optional(), ...assignees, autoLinkPersonalSpace: external_exports.boolean().optional() }),
|
|
41362
|
-
updateActivity: external_exports.strictObject(updateFields),
|
|
41363
|
-
updateActivityTitle: external_exports.strictObject({ activityId: id14, title: external_exports.string() }),
|
|
41364
|
-
updateActivityDeadline: external_exports.strictObject({ activityId: id14, deadline: nullableDeadline.optional() }),
|
|
41365
|
-
updateActivityContent: external_exports.strictObject({ activityId: id14, markdown: external_exports.string().describe(ACTIVITY_BODY_MARKDOWN_DESCRIPTION) }),
|
|
41366
|
-
updateActivityAttributes: attributes,
|
|
41367
|
-
updateActivityAssignees: assignment,
|
|
41368
|
-
toggleActivityCompleted: external_exports.strictObject({ activityId: id14 }),
|
|
41369
|
-
addActivityMessage: external_exports.strictObject({ activityId: id14, content: external_exports.string().regex(/\S/, "Message content is required") }),
|
|
41370
|
-
deleteActivity: external_exports.strictObject({ activityId: id14 }),
|
|
41371
|
-
restoreActivity: external_exports.strictObject({ activityId: id14 }),
|
|
41372
|
-
batchUpdateTasks: external_exports.strictObject({ updates: external_exports.array(external_exports.strictObject({ activityId: id14, completed: external_exports.boolean().optional(), deadline: activityWriteDeadline.optional(), attributes: patchAttributes.optional() })).max(ACTIVITY_WRITE_LIMITS.wireArray) })
|
|
41373
|
-
};
|
|
41374
|
-
function parserMismatch2(operation) {
|
|
41375
|
-
throw new OperationInputError(operation, [{ path: [], reason: "custom" }]);
|
|
41376
|
-
}
|
|
41377
|
-
function parseActivityWriteRequest(operation, raw) {
|
|
41378
|
-
if (raw && typeof raw === "object" && !Array.isArray(raw)) raw = Object.fromEntries(Object.entries(raw).filter(([key, value]) => value !== void 0 || !Object.hasOwn(activityWriteInputs[operation].shape, key)));
|
|
41379
|
-
switch (operation) {
|
|
41380
|
-
case "createActivity": {
|
|
41381
|
-
const input2 = parseOperationInput(operation, activityWriteInputs.createActivity, raw);
|
|
41382
|
-
if (!parseActivityCreateInput(input2, operation).ok) return parserMismatch2(operation);
|
|
41383
|
-
return { operation, input: input2 };
|
|
41384
|
-
}
|
|
41385
|
-
case "updateActivity": {
|
|
41386
|
-
const input2 = parseOperationInput(operation, activityWriteInputs.updateActivity, raw);
|
|
41387
|
-
if (!parseActivityUpdateInput(input2, operation).ok) return parserMismatch2(operation);
|
|
41388
|
-
return { operation, input: input2 };
|
|
41389
|
-
}
|
|
41390
|
-
case "updateActivityTitle":
|
|
41391
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityTitle, raw) };
|
|
41392
|
-
case "updateActivityDeadline":
|
|
41393
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityDeadline, raw) };
|
|
41394
|
-
case "updateActivityContent":
|
|
41395
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityContent, raw) };
|
|
41396
|
-
case "updateActivityAttributes":
|
|
41397
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityAttributes, raw) };
|
|
41398
|
-
case "updateActivityAssignees":
|
|
41399
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.updateActivityAssignees, raw) };
|
|
41400
|
-
case "toggleActivityCompleted":
|
|
41401
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.toggleActivityCompleted, raw) };
|
|
41402
|
-
case "addActivityMessage":
|
|
41403
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.addActivityMessage, raw) };
|
|
41404
|
-
case "deleteActivity":
|
|
41405
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.deleteActivity, raw) };
|
|
41406
|
-
case "restoreActivity":
|
|
41407
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.restoreActivity, raw) };
|
|
41408
|
-
case "batchUpdateTasks":
|
|
41409
|
-
return { operation, input: parseOperationInput(operation, activityWriteInputs.batchUpdateTasks, raw) };
|
|
41410
|
-
}
|
|
41411
|
-
}
|
|
41412
|
-
|
|
41413
41537
|
// ../packages/shared/src/graph-stage-receipts.ts
|
|
41414
41538
|
var graphId = activityWriteInputs.deleteActivity.shape.activityId;
|
|
41415
41539
|
var graphStepSchema = external_exports.strictObject({ step: external_exports.string(), state: external_exports.literal("committed") });
|
|
@@ -41434,45 +41558,6 @@ var uploadRetryInstructions = [
|
|
|
41434
41558
|
"Use a validated storage ID only for a confirmed remaining link step; an unknown upload response may already have stored the file."
|
|
41435
41559
|
];
|
|
41436
41560
|
|
|
41437
|
-
// ../packages/shared/src/activity-write-operation-results.ts
|
|
41438
|
-
var id15 = external_exports.string().min(1);
|
|
41439
|
-
var ack = external_exports.strictObject({ success: external_exports.literal(true) });
|
|
41440
|
-
var activityWriteResults = {
|
|
41441
|
-
createActivity: external_exports.strictObject({ activityId: id15, autoLinkedEntities: external_exports.array(external_exports.strictObject({ entityId: id15, name: external_exports.string() })) }),
|
|
41442
|
-
updateActivity: ack,
|
|
41443
|
-
updateActivityTitle: ack,
|
|
41444
|
-
updateActivityDeadline: ack,
|
|
41445
|
-
updateActivityContent: ack,
|
|
41446
|
-
updateActivityAttributes: ack,
|
|
41447
|
-
updateActivityAssignees: ack,
|
|
41448
|
-
toggleActivityCompleted: external_exports.strictObject({ completed: external_exports.boolean() }),
|
|
41449
|
-
addActivityMessage: external_exports.strictObject({ messageId: id15 }),
|
|
41450
|
-
deleteActivity: ack,
|
|
41451
|
-
restoreActivity: ack,
|
|
41452
|
-
batchUpdateTasks: external_exports.discriminatedUnion("status", [
|
|
41453
|
-
external_exports.strictObject({ status: external_exports.literal("completed"), updated: external_exports.number().int().nonnegative(), total: external_exports.number().int().nonnegative(), committedActivityIds: external_exports.array(id15) }),
|
|
41454
|
-
external_exports.strictObject({ status: external_exports.literal("partial"), updated: external_exports.number().int().nonnegative(), total: external_exports.number().int().nonnegative(), committedActivityIds: external_exports.array(id15), failedIndex: external_exports.number().int().nonnegative(), error: external_exports.strictObject({ code: external_exports.string(), message: external_exports.literal("Task item failed") }) })
|
|
41455
|
-
]).refine((value) => value.updated === value.committedActivityIds.length && (value.status === "completed" ? value.updated === value.total : value.failedIndex === value.updated && value.failedIndex < value.total), "Inconsistent batch commit receipt")
|
|
41456
|
-
};
|
|
41457
|
-
function checked4(schema, raw) {
|
|
41458
|
-
return parseZodOperationResult("activityWrite", schema, raw, "Invalid activity write result");
|
|
41459
|
-
}
|
|
41460
|
-
function projectActivityWriteResult(operation, raw) {
|
|
41461
|
-
switch (operation) {
|
|
41462
|
-
case "createActivity":
|
|
41463
|
-
return checked4(activityWriteResults.createActivity, raw);
|
|
41464
|
-
case "toggleActivityCompleted":
|
|
41465
|
-
return checked4(activityWriteResults.toggleActivityCompleted, raw);
|
|
41466
|
-
case "addActivityMessage":
|
|
41467
|
-
return checked4(activityWriteResults.addActivityMessage, { messageId: checked4(id15, raw) });
|
|
41468
|
-
case "batchUpdateTasks":
|
|
41469
|
-
return checked4(activityWriteResults.batchUpdateTasks, raw);
|
|
41470
|
-
default:
|
|
41471
|
-
if (raw !== null) throw new OperationResultError(operation, "Invalid activity write result");
|
|
41472
|
-
return checked4(ack, { success: true });
|
|
41473
|
-
}
|
|
41474
|
-
}
|
|
41475
|
-
|
|
41476
41561
|
// ../packages/shared/src/task-read-operations.ts
|
|
41477
41562
|
var TASK_READ_LIMITS = { results: 200, children: 100, childLinks: 1e3, childSources: 400 };
|
|
41478
41563
|
var id16 = external_exports.string().min(1).max(128);
|
|
@@ -41904,19 +41989,19 @@ var htmlAliases = {
|
|
|
41904
41989
|
function isHtmlOperationName(name4) {
|
|
41905
41990
|
return Object.hasOwn(htmlInputs, name4);
|
|
41906
41991
|
}
|
|
41907
|
-
var
|
|
41992
|
+
var descriptions4 = {
|
|
41908
41993
|
listHtmlBlocks: "List interactive HTML block summaries in one accessible Ente document, without source. Use an activity ID directly for its body.",
|
|
41909
41994
|
addHtmlBlock: "Append a self-contained interactive HTML block without replacing surrounding document content. Use normal Markdown for non-visual information.",
|
|
41910
41995
|
getHtmlBlock: "Read one interactive HTML block including its source. Read immediately before updateHtmlBlock and copy its artifactId and versionId.",
|
|
41911
41996
|
updateHtmlBlock: "Revise one interactive HTML block without replacing surrounding content. Pass the artifactId and expectedVersionId from the current read; stale updates fail closed."
|
|
41912
41997
|
};
|
|
41913
|
-
function
|
|
41998
|
+
function definition2(name4) {
|
|
41914
41999
|
const schema = external_exports.toJSONSchema(htmlInputs[name4], { io: "input" });
|
|
41915
42000
|
return {
|
|
41916
42001
|
name: name4,
|
|
41917
42002
|
aliases: operationAliases(htmlAliases, name4),
|
|
41918
42003
|
actor: "agent",
|
|
41919
|
-
description:
|
|
42004
|
+
description: descriptions4[name4],
|
|
41920
42005
|
inputSchema: { type: "object", properties: schema.properties ?? {}, required: schema.required ?? [], additionalProperties: false },
|
|
41921
42006
|
resultSchema: operationResultSchema(htmlResults[name4]),
|
|
41922
42007
|
outputSchema: { type: "object", properties: { data: operationResultSchema(htmlResults[name4]) }, required: ["data"], additionalProperties: false },
|
|
@@ -41942,8 +42027,8 @@ function definition(name4) {
|
|
|
41942
42027
|
}
|
|
41943
42028
|
};
|
|
41944
42029
|
}
|
|
41945
|
-
var
|
|
41946
|
-
var htmlCatalog = [...
|
|
42030
|
+
var definitions3 = new Map(Object.keys(htmlInputs).filter(isHtmlOperationName).map((name4) => [name4, definition2(name4)]));
|
|
42031
|
+
var htmlCatalog = [...definitions3.values()];
|
|
41947
42032
|
|
|
41948
42033
|
// ente/htmlBlocks.ts
|
|
41949
42034
|
var htmlArtifactsList = makeFunctionReference2("htmlArtifacts:list");
|
|
@@ -43202,7 +43287,7 @@ var ActivityGet = class extends ClientCommand {
|
|
|
43202
43287
|
const request = parseActivityReadRequest("getActivity", { activityId: this.id, projection: this.projection });
|
|
43203
43288
|
const client = this.client();
|
|
43204
43289
|
const { data } = await client.activityRead("getActivity", request.input);
|
|
43205
|
-
if (!data) {
|
|
43290
|
+
if (!data || data.projection === "tombstone") {
|
|
43206
43291
|
this.emitText({ data: null }, () => "Activity not found or not accessible");
|
|
43207
43292
|
return;
|
|
43208
43293
|
}
|
|
@@ -44031,6 +44116,20 @@ var TaskDone = class extends ProfileCommand {
|
|
|
44031
44116
|
});
|
|
44032
44117
|
}
|
|
44033
44118
|
};
|
|
44119
|
+
var TaskReopen = class extends ClientCommand {
|
|
44120
|
+
static paths = [["task", "reopen"]];
|
|
44121
|
+
static usage = Command.Usage({ category: "Task", description: "Reopen a completed task by full activity ID" });
|
|
44122
|
+
id = options_exports.String();
|
|
44123
|
+
async run() {
|
|
44124
|
+
if (graphTaskNumber(this.id) !== null) throw new Error("Reopen requires the full activity ID; short numbers resolve open tasks only.");
|
|
44125
|
+
parseActivityWriteRequest("updateActivity", { activityId: this.id, completed: false });
|
|
44126
|
+
const client = this.client();
|
|
44127
|
+
const { data } = await client.activityRead("getActivity", { activityId: this.id });
|
|
44128
|
+
if (!data || data.projection === "tombstone" || data.type !== "task") throw new Error("Task not found or not accessible");
|
|
44129
|
+
const result = await client.activityWrite("updateActivity", { activityId: this.id, completed: false });
|
|
44130
|
+
this.emitText(result, () => `Task ${this.id} reopened.`);
|
|
44131
|
+
}
|
|
44132
|
+
};
|
|
44034
44133
|
var TaskAssign = class extends ProfileCommand {
|
|
44035
44134
|
static paths = [["task", "assign"]];
|
|
44036
44135
|
static usage = Command.Usage({ category: "Task", description: "Add assignee to task" });
|
|
@@ -44135,12 +44234,34 @@ var TaskClearAssignees = class extends ProfileCommand {
|
|
|
44135
44234
|
});
|
|
44136
44235
|
}
|
|
44137
44236
|
};
|
|
44237
|
+
var TaskSync = class extends ClientCommand {
|
|
44238
|
+
static paths = [["task", "sync"]];
|
|
44239
|
+
static usage = Command.Usage({ category: "Task", description: "Run a canonical task sync operation with JSON input" });
|
|
44240
|
+
operation = options_exports.String();
|
|
44241
|
+
input = options_exports.String();
|
|
44242
|
+
async run() {
|
|
44243
|
+
const raw = JSON.parse(this.input);
|
|
44244
|
+
if (this.operation === "getActivity") {
|
|
44245
|
+
const request2 = parseActivityReadRequest("getActivity", raw);
|
|
44246
|
+
const result2 = await this.client().activityRead("getActivity", request2.input);
|
|
44247
|
+
this.emitText(result2, () => JSON.stringify(result2));
|
|
44248
|
+
return;
|
|
44249
|
+
}
|
|
44250
|
+
const binding = activityWriteRestBindings.find((item) => item.operation === this.operation);
|
|
44251
|
+
if (!binding) throw new Error("Choose getActivity, createActivity, updateActivity, updateActivityAssignees, deleteActivity or restoreActivity");
|
|
44252
|
+
const request = parseActivityWriteRequest(binding.operation, raw);
|
|
44253
|
+
const result = await this.client().activityWrite(request.operation, request.input);
|
|
44254
|
+
this.emitText(result, () => JSON.stringify(result));
|
|
44255
|
+
}
|
|
44256
|
+
};
|
|
44138
44257
|
var TASK_COMMANDS = [
|
|
44258
|
+
TaskSync,
|
|
44139
44259
|
TaskListCmd,
|
|
44140
44260
|
TaskGet,
|
|
44141
44261
|
TaskCreate,
|
|
44142
44262
|
TaskUpdate,
|
|
44143
44263
|
TaskDone,
|
|
44264
|
+
TaskReopen,
|
|
44144
44265
|
TaskAssign,
|
|
44145
44266
|
TaskUnassign,
|
|
44146
44267
|
TaskSetAssignees,
|
|
@@ -48415,7 +48536,7 @@ var canvasHtmlAliases = {
|
|
|
48415
48536
|
function isCanvasHtmlOperationName(name4) {
|
|
48416
48537
|
return Object.hasOwn(canvasHtmlInputs, name4);
|
|
48417
48538
|
}
|
|
48418
|
-
var
|
|
48539
|
+
var descriptions5 = {
|
|
48419
48540
|
listCanvasBoards: "List accessible persisted canvas boards for an existing entity.",
|
|
48420
48541
|
listCanvasHtmlPanels: "List HTML panel summaries on a persisted canvas board, without source.",
|
|
48421
48542
|
getCanvasHtmlPanel: "Read a complete HTML panel with version and source hash. Missing or deleted panels return null.",
|
|
@@ -48423,13 +48544,13 @@ var descriptions4 = {
|
|
|
48423
48544
|
updateCanvasHtmlPanel: "Replace an HTML panel's title and source, optionally changing geometry. Echo both expectedVersion and expectedSourceHash from a fresh read; conflicts preserve current content.",
|
|
48424
48545
|
deleteCanvasHtmlPanel: "Delete an HTML panel only when both expectedVersion and expectedSourceHash match a fresh read."
|
|
48425
48546
|
};
|
|
48426
|
-
function
|
|
48547
|
+
function definition3(name4) {
|
|
48427
48548
|
const schema = external_exports.toJSONSchema(canvasHtmlInputs[name4], { io: "input" });
|
|
48428
48549
|
return {
|
|
48429
48550
|
name: name4,
|
|
48430
48551
|
aliases: operationAliases(canvasHtmlAliases, name4),
|
|
48431
48552
|
actor: "agent",
|
|
48432
|
-
description:
|
|
48553
|
+
description: descriptions5[name4],
|
|
48433
48554
|
inputSchema: { type: "object", properties: schema.properties ?? {}, required: schema.required ?? [], additionalProperties: false },
|
|
48434
48555
|
errorSchema: operationErrorSchema,
|
|
48435
48556
|
resultSchema: operationResultSchema(canvasHtmlResults[name4]),
|
|
@@ -48447,8 +48568,8 @@ function definition2(name4) {
|
|
|
48447
48568
|
limits: CANVAS_HTML_LIMITS
|
|
48448
48569
|
};
|
|
48449
48570
|
}
|
|
48450
|
-
var
|
|
48451
|
-
var canvasHtmlCatalog = [...
|
|
48571
|
+
var definitions4 = new Map(Object.keys(canvasHtmlInputs).filter(isCanvasHtmlOperationName).map((name4) => [name4, definition3(name4)]));
|
|
48572
|
+
var canvasHtmlCatalog = [...definitions4.values()];
|
|
48452
48573
|
|
|
48453
48574
|
// ente/canvasHtml.ts
|
|
48454
48575
|
var listBoardsRef = makeFunctionReference2(
|
|
@@ -48806,7 +48927,7 @@ function isEntityFileOperationName(value) {
|
|
|
48806
48927
|
return Object.hasOwn(entityFileInputs, value);
|
|
48807
48928
|
}
|
|
48808
48929
|
var personalOnly = "Uses your own Nextcloud connection and is available only to your personal agent.";
|
|
48809
|
-
var
|
|
48930
|
+
var descriptions6 = {
|
|
48810
48931
|
createEntityFolder: `Create a new folder in your Nextcloud below parentPath and link it as the entity's file folder. ${personalOnly}`,
|
|
48811
48932
|
linkEntityFolder: `Link an existing folder of your Nextcloud, given by its path, as the entity's file folder. A folder can belong to one entity only. ${personalOnly}`,
|
|
48812
48933
|
listEntityFiles: `List the files and folders in the entity's linked Nextcloud folder. status explains a missing link or connection instead of an empty list. Item paths are relative to the linked folder; linkedFolderPath is the linked folder's own path from your Nextcloud root, so join it with an item path to address that exact file in Nextcloud instead of searching by name. ${personalOnly}`,
|
|
@@ -48818,13 +48939,13 @@ var READ_OPERATIONS = /* @__PURE__ */ new Set(["listEntityFiles", "searchEntityF
|
|
|
48818
48939
|
function isEntityFileReadOperation(operationName) {
|
|
48819
48940
|
return READ_OPERATIONS.has(operationName);
|
|
48820
48941
|
}
|
|
48821
|
-
function
|
|
48942
|
+
function definition4(operationName) {
|
|
48822
48943
|
const schema = external_exports.toJSONSchema(entityFileInputs[operationName], { io: "input" });
|
|
48823
48944
|
return {
|
|
48824
48945
|
name: operationName,
|
|
48825
48946
|
aliases: operationAliases(entityFileAliases, operationName),
|
|
48826
48947
|
actor: "agent",
|
|
48827
|
-
description:
|
|
48948
|
+
description: descriptions6[operationName],
|
|
48828
48949
|
inputSchema: { type: "object", properties: schema.properties ?? {}, required: schema.required ?? [], additionalProperties: false },
|
|
48829
48950
|
errorSchema: operationErrorSchema,
|
|
48830
48951
|
resultSchema: operationResultSchema(entityFileResults[operationName]),
|
|
@@ -48843,8 +48964,8 @@ function definition3(operationName) {
|
|
|
48843
48964
|
limits: ENTITY_FILE_LIMITS
|
|
48844
48965
|
};
|
|
48845
48966
|
}
|
|
48846
|
-
var
|
|
48847
|
-
var entityFileCatalog = [...
|
|
48967
|
+
var definitions5 = new Map(Object.keys(entityFileInputs).filter(isEntityFileOperationName).map((operationName) => [operationName, definition4(operationName)]));
|
|
48968
|
+
var entityFileCatalog = [...definitions5.values()];
|
|
48848
48969
|
|
|
48849
48970
|
// ente/entityFiles.ts
|
|
48850
48971
|
var createFolderRef = makeFunctionReference2(
|
|
@@ -49263,7 +49384,7 @@ var mailboxOperationContracts = Object.keys(mailboxInputs).map((name4) => ({
|
|
|
49263
49384
|
availability: { hosted: true, external: true, browserHuman: true, agentConnection: true, executionProfiles: ["full"], runtime: "action", MCP: true, REST: true, CLI: true }
|
|
49264
49385
|
}));
|
|
49265
49386
|
function mailboxOperationDefinition(operation) {
|
|
49266
|
-
return mailboxOperationContracts.find((
|
|
49387
|
+
return mailboxOperationContracts.find((definition5) => definition5.name === operation);
|
|
49267
49388
|
}
|
|
49268
49389
|
function parseMailboxOperation(operation, input2) {
|
|
49269
49390
|
return parseOperationInput(operation, mailboxInputs[operation], input2);
|