@cleocode/contracts 2026.9.23 → 2026.9.24

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.
Files changed (80) hide show
  1. package/dist/branch-lock.d.ts +9 -0
  2. package/dist/branch-lock.d.ts.map +1 -1
  3. package/dist/branch-lock.js +25 -3
  4. package/dist/branch-lock.js.map +1 -1
  5. package/dist/cloud/api.d.ts +1 -1
  6. package/dist/data-accessor.d.ts +205 -16
  7. package/dist/data-accessor.d.ts.map +1 -1
  8. package/dist/data-accessor.js.map +1 -1
  9. package/dist/decide.d.ts +110 -1
  10. package/dist/decide.d.ts.map +1 -1
  11. package/dist/decide.js +23 -0
  12. package/dist/decide.js.map +1 -1
  13. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  14. package/dist/dispatch/operations-registry.js +137 -6
  15. package/dist/dispatch/operations-registry.js.map +1 -1
  16. package/dist/doctor.d.ts +9 -0
  17. package/dist/doctor.d.ts.map +1 -1
  18. package/dist/exit-codes.d.ts +7 -0
  19. package/dist/exit-codes.d.ts.map +1 -1
  20. package/dist/exit-codes.js +7 -0
  21. package/dist/exit-codes.js.map +1 -1
  22. package/dist/index.d.ts +9 -6
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/knowledge-health.d.ts +21 -0
  27. package/dist/knowledge-health.d.ts.map +1 -1
  28. package/dist/nexus-account.d.ts +160 -0
  29. package/dist/nexus-account.d.ts.map +1 -0
  30. package/dist/nexus-account.js +68 -0
  31. package/dist/nexus-account.js.map +1 -0
  32. package/dist/operations/focus.d.ts +7 -3
  33. package/dist/operations/focus.d.ts.map +1 -1
  34. package/dist/operations/nexus-scope-map.d.ts +8 -0
  35. package/dist/operations/nexus-scope-map.d.ts.map +1 -1
  36. package/dist/operations/nexus-scope-map.js +8 -0
  37. package/dist/operations/nexus-scope-map.js.map +1 -1
  38. package/dist/operations/nexus.d.ts +265 -0
  39. package/dist/operations/nexus.d.ts.map +1 -1
  40. package/dist/operations/nexus.js +9 -1
  41. package/dist/operations/nexus.js.map +1 -1
  42. package/dist/operations/orchestrate.d.ts +6 -1
  43. package/dist/operations/orchestrate.d.ts.map +1 -1
  44. package/dist/operations/output-contracts-data.d.ts.map +1 -1
  45. package/dist/operations/output-contracts-data.js +115 -1
  46. package/dist/operations/output-contracts-data.js.map +1 -1
  47. package/dist/operations/tasks.d.ts +73 -9
  48. package/dist/operations/tasks.d.ts.map +1 -1
  49. package/dist/operations/tasks.js.map +1 -1
  50. package/dist/project-lifecycle.d.ts +6 -2
  51. package/dist/project-lifecycle.d.ts.map +1 -1
  52. package/dist/session.d.ts +19 -1
  53. package/dist/session.d.ts.map +1 -1
  54. package/dist/session.js +9 -2
  55. package/dist/session.js.map +1 -1
  56. package/dist/task.d.ts +35 -1
  57. package/dist/task.d.ts.map +1 -1
  58. package/dist/tools/score-task-priority.d.ts +1 -1
  59. package/dist/tools/score-task-priority.d.ts.map +1 -1
  60. package/package.json +2 -2
  61. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  62. package/src/branch-lock.ts +38 -3
  63. package/src/data-accessor.ts +211 -16
  64. package/src/decide.ts +127 -1
  65. package/src/dispatch/operations-registry.ts +144 -6
  66. package/src/doctor.ts +9 -0
  67. package/src/exit-codes.ts +7 -0
  68. package/src/index.ts +48 -0
  69. package/src/knowledge-health.ts +22 -0
  70. package/src/nexus-account.ts +181 -0
  71. package/src/operations/focus.ts +7 -3
  72. package/src/operations/nexus-scope-map.ts +9 -0
  73. package/src/operations/nexus.ts +281 -0
  74. package/src/operations/orchestrate.ts +6 -2
  75. package/src/operations/output-contracts-data.ts +125 -1
  76. package/src/operations/tasks.ts +78 -12
  77. package/src/project-lifecycle.ts +6 -2
  78. package/src/session.ts +20 -2
  79. package/src/task.ts +37 -1
  80. package/src/tools/score-task-priority.ts +1 -1
package/dist/decide.js CHANGED
@@ -66,8 +66,31 @@ export const DECISION_REQUEST_LIMITS = {
66
66
  export const DECISION_PROVIDER_KINDS = ['layahost', 'jev'];
67
67
  /** Base URL of the layahost API (its OpenAPI `servers[0].url`). */
68
68
  export const LAYAHOST_BASE_URL = 'https://layahost.com';
69
+ /**
70
+ * Base URL of Jev's own API (TypeSafe AI). Source: the canonical spec
71
+ * `system-one-integration`, "Provider research: capability map" ("Jev itself
72
+ * (TypeSafe AI, `https://api.typesafe.ai`, OpenAPI v0.2.0)").
73
+ */
74
+ export const JEV_DEFAULT_BASE_URL = 'https://api.typesafe.ai';
69
75
  /** layahost's routing model, the default for a layahost connection. */
70
76
  export const LAYAHOST_DEFAULT_MODEL = 'laya-auto';
77
+ // ─── Named provider profiles (T12733) ────────────────────────────────────────
78
+ /**
79
+ * A valid profile name: 1-32 characters of lowercase letters, digits and
80
+ * `-`, starting and ending with a letter or digit (e.g. `default`, `work`,
81
+ * `team-b`). A profile is addressed as `<provider>/<name>`, e.g.
82
+ * `layahost/default` or `jev/team`; one provider may hold several profiles
83
+ * (accounts), each with its own key.
84
+ */
85
+ export const DECIDE_PROFILE_NAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$/;
86
+ /** The profile name used when none is given: `<provider>/default`. */
87
+ export const DECIDE_DEFAULT_PROFILE_NAME = 'default';
88
+ /**
89
+ * The stored `baseUrl` of a profile that uses its provider's preset URL. It
90
+ * is resolved when the profile is used, so a changed preset URL flows
91
+ * through to every profile that kept the default.
92
+ */
93
+ export const DECIDE_PROFILE_DEFAULT_URL = 'default';
71
94
  /** The Jev minimum every provider supports; the default when a provider reports nothing. */
72
95
  export const JEV_MINIMUM_CAPABILITIES = {
73
96
  wire: 'jev-systemone/1',
@@ -1 +1 @@
1
- {"version":3,"file":"decide.js","sourceRoot":"","sources":["../src/decide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF,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CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE;IAChB,QAAQ,EAAE,0BAA0B,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAeD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EAu9UpC,CAAC"}
1
+ {"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAeD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EAimVpC,CAAC"}
@@ -3004,6 +3004,13 @@ export const OPERATIONS = [
3004
3004
  description: 'taskId parameter',
3005
3005
  cli: { positional: true },
3006
3006
  },
3007
+ {
3008
+ name: 'expectedUpdatedAt',
3009
+ type: 'string',
3010
+ required: false,
3011
+ description: 'Optimistic-concurrency guard: fail with E_CONFLICT unless the task updatedAt still equals this value',
3012
+ cli: { flag: 'if-match' },
3013
+ },
3007
3014
  ],
3008
3015
  },
3009
3016
  {
@@ -3663,7 +3670,7 @@ export const OPERATIONS = [
3663
3670
  gateway: 'mutate',
3664
3671
  domain: 'tasks',
3665
3672
  operation: 'start',
3666
- description: 'tasks.start (mutate)',
3673
+ description: "tasks.start (mutate) — start work and take the caller session's leased claim (E_TASK_CLAIMED when another session holds it)",
3667
3674
  tier: 0,
3668
3675
  idempotent: false,
3669
3676
  sessionRequired: false,
@@ -3676,6 +3683,20 @@ export const OPERATIONS = [
3676
3683
  description: 'taskId parameter',
3677
3684
  cli: { positional: true },
3678
3685
  },
3686
+ {
3687
+ name: 'takeOver',
3688
+ type: 'boolean',
3689
+ required: false,
3690
+ description: "Take over another session's EXPIRED claim lease (audited)",
3691
+ cli: { flag: 'take-over' },
3692
+ },
3693
+ {
3694
+ name: 'forceClaim',
3695
+ type: 'boolean',
3696
+ required: false,
3697
+ description: "Take over another session's LIVE claim lease (audited)",
3698
+ cli: { flag: 'force-claim' },
3699
+ },
3679
3700
  ],
3680
3701
  },
3681
3702
  {
@@ -3784,11 +3805,11 @@ export const OPERATIONS = [
3784
3805
  gateway: 'mutate',
3785
3806
  domain: 'tasks',
3786
3807
  operation: 'claim',
3787
- description: 'tasks.claim (mutate) — claim a task by assigning it to the current session',
3808
+ description: "tasks.claim (mutate) — take, renew or override the caller session's leased claim on a task (never the human assignee)",
3788
3809
  tier: 0,
3789
3810
  idempotent: false,
3790
3811
  sessionRequired: true,
3791
- requiredParams: ['taskId', 'agentId'],
3812
+ requiredParams: ['taskId'],
3792
3813
  params: [
3793
3814
  {
3794
3815
  name: 'taskId',
@@ -3799,8 +3820,26 @@ export const OPERATIONS = [
3799
3820
  {
3800
3821
  name: 'agentId',
3801
3822
  type: 'string',
3802
- required: true,
3803
- description: 'Agent ID to assign the task to',
3823
+ required: false,
3824
+ description: "Agent ID recorded with the lease (default: the session's agent / CLEO_AGENT_ID)",
3825
+ },
3826
+ {
3827
+ name: 'renew',
3828
+ type: 'boolean',
3829
+ required: false,
3830
+ description: "Renew the caller's own lease",
3831
+ },
3832
+ {
3833
+ name: 'takeOver',
3834
+ type: 'boolean',
3835
+ required: false,
3836
+ description: "Take over another session's EXPIRED lease (audited)",
3837
+ },
3838
+ {
3839
+ name: 'forceClaim',
3840
+ type: 'boolean',
3841
+ required: false,
3842
+ description: "Take over another session's LIVE lease (audited)",
3804
3843
  },
3805
3844
  ],
3806
3845
  },
@@ -3808,7 +3847,7 @@ export const OPERATIONS = [
3808
3847
  gateway: 'mutate',
3809
3848
  domain: 'tasks',
3810
3849
  operation: 'unclaim',
3811
- description: 'tasks.unclaim (mutate) — unclaim a task by removing the current assignee',
3850
+ description: "tasks.unclaim (mutate) — release the caller session's claim lease (never the human assignee)",
3812
3851
  tier: 0,
3813
3852
  idempotent: false,
3814
3853
  sessionRequired: true,
@@ -3820,6 +3859,12 @@ export const OPERATIONS = [
3820
3859
  required: true,
3821
3860
  description: 'Task ID to unclaim',
3822
3861
  },
3862
+ {
3863
+ name: 'forceClaim',
3864
+ type: 'boolean',
3865
+ required: false,
3866
+ description: "Release another session's lease (audited)",
3867
+ },
3823
3868
  ],
3824
3869
  },
3825
3870
  {
@@ -4074,6 +4119,20 @@ export const OPERATIONS = [
4074
4119
  required: false,
4075
4120
  description: 'When true (default), adds toTaskId as a dependency on fromTaskId so it cannot complete before the pivot resolves',
4076
4121
  },
4122
+ {
4123
+ name: 'takeOver',
4124
+ type: 'boolean',
4125
+ required: false,
4126
+ description: "Take over another session's EXPIRED claim on toTaskId (audited)",
4127
+ cli: { flag: 'take-over' },
4128
+ },
4129
+ {
4130
+ name: 'forceClaim',
4131
+ type: 'boolean',
4132
+ required: false,
4133
+ description: "Take over another session's LIVE claim on toTaskId (audited)",
4134
+ cli: { flag: 'force-claim' },
4135
+ },
4077
4136
  ],
4078
4137
  },
4079
4138
  // parallel.start and parallel.end merged into orchestrate.parallel via action param (T5615)
@@ -6717,6 +6776,78 @@ export const OPERATIONS = [
6717
6776
  requiredParams: [],
6718
6777
  params: [],
6719
6778
  },
6779
+ {
6780
+ gateway: 'query',
6781
+ domain: 'nexus',
6782
+ operation: 'projects.fleet',
6783
+ description: 'nexus.projects.fleet (query) — fleet view: every project with its location on each device, last recorded git state (local, and remote as of the last fetch) and staleness; paged, counts first, read-only',
6784
+ tier: 1,
6785
+ idempotent: true,
6786
+ sessionRequired: false,
6787
+ requiredParams: [],
6788
+ params: [
6789
+ {
6790
+ name: 'device',
6791
+ type: 'string',
6792
+ required: false,
6793
+ description: 'Only locations on this device (device id, hostname, or current)',
6794
+ },
6795
+ {
6796
+ name: 'missing',
6797
+ type: 'boolean',
6798
+ required: false,
6799
+ description: 'Only projects with a missing location',
6800
+ },
6801
+ {
6802
+ name: 'dirty',
6803
+ type: 'boolean',
6804
+ required: false,
6805
+ description: 'Only projects with a dirty location',
6806
+ },
6807
+ {
6808
+ name: 'behind',
6809
+ type: 'boolean',
6810
+ required: false,
6811
+ description: 'Only projects with a location behind its upstream (as of the last fetch)',
6812
+ },
6813
+ {
6814
+ name: 'ahead',
6815
+ type: 'boolean',
6816
+ required: false,
6817
+ description: 'Only projects with a location ahead of its upstream (as of the last fetch)',
6818
+ },
6819
+ {
6820
+ name: 'stale',
6821
+ type: 'boolean',
6822
+ required: false,
6823
+ description: 'Only projects with a never-probed, old-probe or old-fetch location',
6824
+ },
6825
+ {
6826
+ name: 'errored',
6827
+ type: 'boolean',
6828
+ required: false,
6829
+ description: 'Only projects whose last probe recorded an error',
6830
+ },
6831
+ {
6832
+ name: 'staleAfterMs',
6833
+ type: 'number',
6834
+ required: false,
6835
+ description: 'Staleness window for probes, fetches and heartbeats (default 24h)',
6836
+ },
6837
+ {
6838
+ name: 'limit',
6839
+ type: 'number',
6840
+ required: false,
6841
+ description: 'Page size in projects (default 50, max 500; 0 = all)',
6842
+ },
6843
+ {
6844
+ name: 'offset',
6845
+ type: 'number',
6846
+ required: false,
6847
+ description: 'Projects skipped before the page',
6848
+ },
6849
+ ],
6850
+ },
6720
6851
  {
6721
6852
  gateway: 'mutate',
6722
6853
  domain: 'nexus',