ente-cli 0.4.131 → 0.4.133

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/README.md CHANGED
@@ -715,6 +715,6 @@ Canvas HTML panel commands negotiate `spaceOwned: true` for boards without entit
715
715
 
716
716
  ### Activity fields
717
717
 
718
- Use `--field key=value` or repeat typed JSON inputs such as `--field '{"label":"Estimate","type":"number","value":3}'`. Task and list `--attr` is a shorthand for canonical field writes. API writes accept `fields: [{label | fieldId, type?, value}]`; `value: null` removes a value. Activity `attributes` inputs fail with `ACTIVITY_ATTRIBUTES_RETIRED`, which explains the replacement. Read results expose `fields` only.
718
+ Use `--field key=value` or repeat typed JSON inputs such as `--field '{"label":"Estimate","type":"number","value":3}'`. Repeating a shorthand label sends a list that replaces the field. Text, URL, email, phone, postal-address, salutation, job-title and multi-select fields hold lists, and a lookup matches any one value. Create a new list field with an explicit type, because an untyped list creates a multi-select: `--field '{"label":"links","type":"url","value":["app://items/a1","https://example.com/x"]}'`; afterwards `--field links=app://items/a1 --field links=app://items/b2` replaces the list. Task and list `--attr` is a shorthand for canonical field writes. API writes accept `fields: [{label | fieldId, type?, value}]`; `value: null` removes a value. Activity `attributes` inputs fail with `ACTIVITY_ATTRIBUTES_RETIRED`, which explains the replacement. Read results expose `fields` only.
719
719
 
720
720
  Database import JSONL rows use `{"title":"Fictional row","fields":[{"label":"repo","value":"stable-key"}],"content":"Optional markdown"}`. Imports validate every row before writing and keep fields omitted from a row unchanged. See `docs/activity-fields.md`.
package/dist/SKILL.md CHANGED
@@ -1018,7 +1018,7 @@ Entity exact-value lookup: `ente entity list --field "External ID=Case=ID"`. The
1018
1018
 
1019
1019
  Activity field lookup uses the server index: `ente activity list --type task --field "t3_thread=t3code://threads/<env>/<id>" --profile ente-operator`. For the credential's own agent queue, use `ente agent tasks list --field "t3_thread=t3code://threads/<env>/<id>" --profile ente-operator`. `--attr` is an alias for `--field` on these two commands. Repeat the option for AND matching (at most ten filters). The first `=` separates label and value, preserving subsequent equals signs. Activity list also accepts `--space` and `--entity` to narrow the indexed result. History cursors and `--min-count` cannot be combined with a field lookup.
1020
1020
 
1021
- Activity writes and each `batchUpdateTasks` item accept `fields: [{label | fieldId, type?, value}]` through REST/MCP and `task sync createActivity|updateActivity`. Exactly one selector is required. `value: null` removes; number/boolean use typed JSON values, multi-select accepts string arrays, and JSON uses serialized JSON strings. Existing types cannot be changed by a value write. Repeated selectors fail before writing. Invalid typed values use `ACTIVITY_FIELD_VALUE_INVALID`; vocabulary and byte caps use `ACTIVITY_FIELD_LIMIT_EXCEEDED`. Delegation and idempotency follow the ordinary activity write rules.
1021
+ Activity writes and each `batchUpdateTasks` item accept `fields: [{label | fieldId, type?, value}]` through REST/MCP and `task sync createActivity|updateActivity`. Exactly one selector is required. `value: null` removes; number/boolean use typed JSON values, JSON uses serialized JSON strings, and list fields (text, URL, email, phone, postal-address, salutation, job-title, multi-select) accept a string array that replaces the whole list (one stored value each; only multi-select has an option vocabulary). Create a list field with an explicit `type`; on the CLI repeat a shorthand label (`--field links=a --field links=b`). A `--field label=value` lookup matches an activity when any one of its values matches. URLs with a non-web scheme compare exactly apart from the scheme's case. Merging activities unites list values (as a set, no order kept) and assignees and fills empty single-valued fields from the source. Existing types cannot be changed by a value write. Repeated selectors fail before writing. Invalid typed values use `ACTIVITY_FIELD_VALUE_INVALID`; vocabulary and byte caps use `ACTIVITY_FIELD_LIMIT_EXCEEDED`. Delegation and idempotency follow the ordinary activity write rules.
1022
1022
 
1023
1023
  ```sh
1024
1024
  ente activity update <id> --field '{"label":"estimate","type":"number","value":3}' --profile ente-operator --json
package/dist/cli.mjs CHANGED
@@ -27848,6 +27848,10 @@ var ACTIVITY_FIELD_TYPE_VALUES = [...FIELD_TYPE_VALUES, "number", "boolean", "si
27848
27848
  var activityFieldTypeValidator = v.union(...ACTIVITY_FIELD_TYPE_VALUES.map((type) => v.literal(type)));
27849
27849
  var activityFieldTypeSchema = external_exports.enum(ACTIVITY_FIELD_TYPE_VALUES);
27850
27850
  var activityFieldOptionValidator = v.object({ value: v.string(), label: v.optional(v.string()), color: v.optional(v.string()) });
27851
+ var ACTIVITY_LIST_FIELD_TYPES = ["text", "email", "phone", "url", "postal-address", "salutation", "job-title", "multi-select"];
27852
+ function isActivityListFieldType(type) {
27853
+ return ACTIVITY_LIST_FIELD_TYPES.includes(type);
27854
+ }
27851
27855
  var MAX_ACTIVITY_FIELD_VALUES = 1e3;
27852
27856
  var externalActivityFieldValueSchema = external_exports.strictObject({ valueId: external_exports.string(), fieldId: external_exports.string(), label: external_exports.string(), type: activityFieldTypeSchema, value: external_exports.string() });
27853
27857
  function activityFieldDisplayEntries(source2) {
@@ -27869,7 +27873,7 @@ var MAX_ACTIVITY_FIELD_DEFINITION_READ_BYTES = 6 * 1024 * 1024;
27869
27873
  function activityFieldValue(type, values) {
27870
27874
  const first = values[0];
27871
27875
  if (first === void 0) return void 0;
27872
- return type === "multi-select" ? values : type === "number" ? Number(first) : type === "boolean" ? first.trim().toLowerCase() === "true" : type === "json" ? JSON.parse(first) : first;
27876
+ return type === "multi-select" || values.length > 1 && isActivityListFieldType(type) ? values : type === "number" ? Number(first) : type === "boolean" ? first.trim().toLowerCase() === "true" : type === "json" ? JSON.parse(first) : first;
27873
27877
  }
27874
27878
 
27875
27879
  // ../packages/shared/src/activity-dates.ts
@@ -28694,6 +28698,13 @@ function parseFieldPairs(pairs) {
28694
28698
  }
28695
28699
  return result;
28696
28700
  }
28701
+ function parseFieldPairList(pairs) {
28702
+ return (pairs ?? []).map((pair2) => {
28703
+ const eq = pair2.indexOf("=");
28704
+ if (eq === -1) throw new Error(`Invalid field format: '${pair2}'. Use key=value.`);
28705
+ return [pair2.slice(0, eq), pair2.slice(eq + 1)];
28706
+ });
28707
+ }
28697
28708
  function parseOperationFieldPairs(operation, pairs) {
28698
28709
  try {
28699
28710
  return parseFieldPairs(pairs);
@@ -28703,7 +28714,7 @@ function parseOperationFieldPairs(operation, pairs) {
28703
28714
  }
28704
28715
 
28705
28716
  // ente/version.ts
28706
- var VERSION = "0.4.131";
28717
+ var VERSION = "0.4.133";
28707
28718
 
28708
28719
  // ente/branding.ts
28709
28720
  var NPM_REGISTRY = "https://registry.npmjs.org";
@@ -29037,8 +29048,8 @@ function operationResultSchema(validator) {
29037
29048
  // ../packages/shared/src/activity-write-catalog.ts
29038
29049
  var composite = /* @__PURE__ */ new Set(["updateActivityAssignees", "toggleActivityCompleted", "batchUpdateTasks"]);
29039
29050
  var descriptions = {
29040
- 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. fields use label or fieldId, optional type and typed value; null clears. JSON is serialized text. New labels/options follow writer rules. Missing owner grants require human review.",
29041
- updateActivity: "Update supplied fields in the activity's actual space. Fields use label or fieldId with typed values; null clears, new select options are implicit, JSON is serialized text. Existing fields cannot be retyped. The removed attributes input is rejected; use fields. Explicit completed is idempotent. Owners must already belong to the activity space. Provider-backed email body and type restrictions remain enforced.",
29051
+ 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. fields use label or fieldId, optional type and typed value; null clears. A string list replaces a list field (text, url, email, phone, address, multi-select). JSON is serialized text. New labels/options follow writer rules. Missing owner grants require human review.",
29052
+ updateActivity: "Update supplied fields in the activity's actual space. Fields use label or fieldId with typed values; null clears, a string list replaces a list field (text, url, email, phone, postal-address, salutation, job-title, multi-select); give type when a new label holds a list, new select options are implicit, JSON is serialized text. Existing fields cannot be retyped. The removed attributes input is rejected; use fields. Explicit completed is idempotent. Owners must already belong to the activity space. Provider-backed email body and type restrictions remain enforced.",
29042
29053
  updateActivityTitle: "Set or clear an activity title. Existing revision and verified updater bookkeeping stay in the same transaction.",
29043
29054
  updateActivityDeadline: "Set a readable or finite epoch deadline; null clears it and omission leaves it unchanged in this profile.",
29044
29055
  updateActivityContent: "Replace the ordinary activity body with markdown, preserving revisions and read-only provider-email policy. Version-window editing is a separate operation family.",
@@ -42909,22 +42920,41 @@ function requireEntitySelector(operation, value, field) {
42909
42920
  }
42910
42921
 
42911
42922
  // ente/activity-fields.ts
42912
- function parseActivityFields(flags) {
42913
- if (flags === void 0) return void 0;
42914
- const inputs = flags.map((flag, index) => {
42923
+ function parseActivityFields(flags, pairs = []) {
42924
+ if (flags === void 0 && !pairs.length) return void 0;
42925
+ const inputs = [];
42926
+ const lists = /* @__PURE__ */ new Map();
42927
+ const shorthand = (label, value) => {
42928
+ const key = fieldLabelKey(label);
42929
+ const list2 = lists.get(key);
42930
+ if (list2) {
42931
+ list2.values.push(value);
42932
+ return;
42933
+ }
42934
+ const entry = { label, values: [value] };
42935
+ lists.set(key, entry);
42936
+ inputs.push(entry);
42937
+ };
42938
+ (flags ?? []).forEach((flag, index) => {
42915
42939
  try {
42916
42940
  const first = flag.trimStart()[0];
42917
42941
  if (first !== "{" && first !== "[" && first !== '"') {
42918
42942
  const equals = flag.indexOf("=");
42919
42943
  if (equals <= 0) throw Error("Invalid field shorthand");
42920
- return { label: flag.slice(0, equals), value: flag.slice(equals + 1) || null };
42921
- }
42922
- return JSON.parse(flag);
42944
+ shorthand(flag.slice(0, equals), flag.slice(equals + 1));
42945
+ } else inputs.push(JSON.parse(flag));
42923
42946
  } catch {
42924
42947
  throw new OperationInputError("activityFields", [{ path: ["fields", String(index)], reason: "invalid_type" }]);
42925
42948
  }
42926
42949
  });
42927
- return parseOperationInput("activityFields", activityFieldInputsSchema, inputs);
42950
+ for (const [label, value] of pairs) shorthand(label, value);
42951
+ const resolved = inputs.map((input2) => {
42952
+ if (!input2 || typeof input2 !== "object" || !("values" in input2)) return input2;
42953
+ const { label, values } = input2;
42954
+ const present = values.filter((value) => value);
42955
+ return { label, value: !present.length ? null : values.length === 1 ? present[0] : present };
42956
+ });
42957
+ return parseOperationInput("activityFields", activityFieldInputsSchema, resolved);
42928
42958
  }
42929
42959
  var created = external_exports.strictObject({ data: activityWriteResults.createActivity });
42930
42960
  var updated = external_exports.strictObject({ data: activityWriteResults.updateActivity });
@@ -43794,7 +43824,7 @@ var ActivityCreate = class extends ClientCommand {
43794
43824
  entitySpaceGrantFingerprint = options_exports.String("--entity-space-grant-fingerprint", {
43795
43825
  description: "Exact grant fingerprint returned by the confirmation-required error"
43796
43826
  });
43797
- field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeatable, empty/null removes" });
43827
+ field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeat a label for a list (replaces the field), empty/null removes" });
43798
43828
  async run() {
43799
43829
  const fields4 = parseActivityFields(this.field);
43800
43830
  if (fields4 !== void 0 && (this.autoLink || this.entitySpaceGrantFingerprint !== void 0)) throw new Error("--field requires owners already in the destination space; complete sharing separately before using --field.");
@@ -43896,7 +43926,7 @@ var ActivityUpdate = class extends ClientCommand {
43896
43926
  clearDeadline = options_exports.Boolean("--clear-deadline", false, { description: "Remove the deadline" });
43897
43927
  entityAdd = options_exports.Array("--entity-add", { description: "Link additional entities" });
43898
43928
  entityRemove = options_exports.Array("--entity-remove", { description: "Unlink entities" });
43899
- field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeatable, empty/null removes" });
43929
+ field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeat a label for a list (replaces the field), empty/null removes" });
43900
43930
  async run() {
43901
43931
  const fields4 = parseActivityFields(this.field);
43902
43932
  const content = graphConvert("content", () => readContentOption(this.content, this.contentFile));
@@ -44266,10 +44296,10 @@ var TaskCreate = class extends ClientCommand {
44266
44296
  entitySpaceGrantFingerprint = options_exports.String("--entity-space-grant-fingerprint", {
44267
44297
  description: "Exact grant fingerprint returned by the confirmation-required error"
44268
44298
  });
44269
- field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeatable, empty/null removes" });
44299
+ field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeat a label for a list (replaces the field), empty/null removes" });
44270
44300
  async run() {
44271
- const aliases = graphConvert("fields", () => Object.entries(parseFieldPairs(this.attr)).map(([label, value]) => JSON.stringify({ label, value: value || null })));
44272
- const fields4 = parseActivityFields(this.field === void 0 && !aliases.length ? void 0 : [...this.field ?? [], ...aliases]);
44301
+ const aliases = graphConvert("fields", () => parseFieldPairList(this.attr));
44302
+ const fields4 = parseActivityFields(this.field, aliases);
44273
44303
  if (fields4 !== void 0 && (this.autoLink || this.entitySpaceGrantFingerprint !== void 0)) throw new Error("--field requires owners already in the destination space; complete sharing separately before using --field.");
44274
44304
  if (this.noDeadline && this.deadline !== void 0) throw new Error("Use either --deadline or --no-deadline, not both.");
44275
44305
  const deadline = this.noDeadline ? void 0 : graphConvert("deadline", () => this.deadline === void 0 ? defaultDeadline() : parseDeadline(this.deadline));
@@ -44313,10 +44343,10 @@ var TaskUpdate = class extends ClientCommand {
44313
44343
  attr = options_exports.Array("--attr", { description: "Canonical key=value shorthand for --field" });
44314
44344
  deadline = options_exports.String("--deadline", { description: "Update deadline (human-friendly)" });
44315
44345
  clearDeadline = options_exports.Boolean("--clear-deadline", false, { description: "Remove the deadline" });
44316
- field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeatable, empty/null removes" });
44346
+ field = options_exports.Array("--field", { description: "Field key=value or typed JSON: {label or fieldId, optional type, value}; repeat a label for a list (replaces the field), empty/null removes" });
44317
44347
  async run() {
44318
- const aliases = graphConvert("fields", () => Object.entries(parseFieldPairs(this.attr)).map(([label, value]) => JSON.stringify({ label, value: value || null })));
44319
- const fields4 = parseActivityFields(this.field === void 0 && !aliases.length ? void 0 : [...this.field ?? [], ...aliases]);
44348
+ const aliases = graphConvert("fields", () => parseFieldPairList(this.attr));
44349
+ const fields4 = parseActivityFields(this.field, aliases);
44320
44350
  graphTaskNumber(this.id);
44321
44351
  if (this.clearDeadline && this.deadline !== void 0) throw new Error("Use either --deadline or --clear-deadline, not both.");
44322
44352
  const deadline = graphConvert("deadline", () => deadlineChange(this.deadline, this.clearDeadline));