@kitman-sh/cli 0.13.7 → 0.13.9

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 (27) hide show
  1. package/dist/{chunk-pxvd8w2v.js → chunk-0tjg9eya.js} +1 -1
  2. package/dist/{chunk-9g8tc40f.js → chunk-0wj65j5e.js} +7 -7
  3. package/dist/{chunk-4bgj3b5r.js → chunk-1ht6jwzm.js} +10 -9
  4. package/dist/{chunk-4crf5vhd.js → chunk-53qp6kcp.js} +2 -2
  5. package/dist/{chunk-xt97vb58.js → chunk-69fcvx7d.js} +109 -65
  6. package/dist/{chunk-bbks1scp.js → chunk-6jtjcvnc.js} +60 -46
  7. package/dist/{chunk-4x3zm541.js → chunk-9gg1w4aa.js} +353 -434
  8. package/dist/{chunk-m406nanz.js → chunk-a44ebqzx.js} +6 -6
  9. package/dist/{chunk-t82w7459.js → chunk-aezq3fyy.js} +69 -218
  10. package/dist/{chunk-24h0y27w.js → chunk-cw61zyh5.js} +1 -1
  11. package/dist/{chunk-kk32jckf.js → chunk-ezv4p0zr.js} +4 -4
  12. package/dist/{chunk-mmd7mjv0.js → chunk-fh58za51.js} +3 -3
  13. package/dist/{chunk-m079pjdy.js → chunk-hezxa6q5.js} +7 -7
  14. package/dist/{chunk-vxfajzpz.js → chunk-kq88aaa3.js} +62 -16
  15. package/dist/{chunk-x44re8th.js → chunk-ksgt1tdc.js} +7 -7
  16. package/dist/{chunk-t37qzgmb.js → chunk-pj3mer60.js} +4 -4
  17. package/dist/{chunk-zgraq2y3.js → chunk-qjqa338f.js} +308 -111
  18. package/dist/{chunk-1nxcn08k.js → chunk-qkjfx2ts.js} +16 -16
  19. package/dist/{chunk-byg71zra.js → chunk-rz18qefg.js} +7 -7
  20. package/dist/{chunk-bs5bh8ys.js → chunk-s63fjc69.js} +20 -20
  21. package/dist/{chunk-mtdz4k32.js → chunk-tspf987k.js} +5 -5
  22. package/dist/{chunk-8v0t5kzg.js → chunk-v190zzc5.js} +1 -1
  23. package/dist/{chunk-22z1yemd.js → chunk-wzr1n3zy.js} +11 -5
  24. package/dist/{chunk-jbjz7b6n.js → chunk-x8sewxzm.js} +106 -106
  25. package/dist/{chunk-ggmwpwhf.js → chunk-z5f7g1w1.js} +2 -2
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -17,12 +17,12 @@ import {
17
17
  isSuccess,
18
18
  TaggedError,
19
19
  void_2,
20
- makeUnsafe5,
20
+ makeUnsafe4,
21
21
  _await,
22
22
  fail5,
23
23
  succeed4,
24
24
  doneUnsafe,
25
- makeUnsafe6,
25
+ makeUnsafe5,
26
26
  provide,
27
27
  close,
28
28
  buildWithScope,
@@ -30,6 +30,7 @@ import {
30
30
  provide2,
31
31
  provideMerge,
32
32
  squash,
33
+ currentTimeMillis,
33
34
  spaced,
34
35
  all3,
35
36
  forEach,
@@ -49,7 +50,7 @@ import {
49
50
  tap2,
50
51
  result,
51
52
  option2,
52
- map8,
53
+ map7,
53
54
  as,
54
55
  asVoid,
55
56
  catch_,
@@ -79,6 +80,8 @@ import {
79
80
  runSync,
80
81
  fnUntraced,
81
82
  fn,
83
+ makeUnsafe6,
84
+ formatIso,
82
85
  decodeUnknownEffect2,
83
86
  optionalKey,
84
87
  optional,
@@ -118,12 +121,9 @@ import {
118
121
  decodeJsonStringOption,
119
122
  encodeJsonStringSync,
120
123
  encodePrettyJsonString
121
- } from "./chunk-zgraq2y3.js";
124
+ } from "./chunk-qjqa338f.js";
122
125
  import {
123
- currentTimeMillis,
124
126
  SecureRandom,
125
- makeUnsafe,
126
- formatIso,
127
127
  error,
128
128
  parseDate,
129
129
  currentDate,
@@ -158,8 +158,8 @@ import {
158
158
  sessionForApi,
159
159
  readAuthStore,
160
160
  agentCredentialForApi,
161
- make5,
162
161
  make6,
162
+ make7,
163
163
  Service,
164
164
  shouldRefresh,
165
165
  refreshSession,
@@ -170,7 +170,7 @@ import {
170
170
  runMcpEffect,
171
171
  createAgentAuthSignedFetch,
172
172
  setupMcpAgentCredential
173
- } from "./chunk-4x3zm541.js";
173
+ } from "./chunk-9gg1w4aa.js";
174
174
  import {
175
175
  join,
176
176
  interrupt,
@@ -184,27 +184,27 @@ import {
184
184
  withDefault,
185
185
  option,
186
186
  String2
187
- } from "./chunk-t82w7459.js";
187
+ } from "./chunk-aezq3fyy.js";
188
188
  import {
189
189
  guard,
190
190
  Id,
191
191
  Timestamp,
192
192
  ActorType
193
- } from "./chunk-pxvd8w2v.js";
193
+ } from "./chunk-0tjg9eya.js";
194
194
  import {
195
195
  searchDocs2,
196
196
  readDoc2
197
- } from "./chunk-22z1yemd.js";
197
+ } from "./chunk-wzr1n3zy.js";
198
198
  import {
199
199
  nextInt
200
- } from "./chunk-24h0y27w.js";
200
+ } from "./chunk-cw61zyh5.js";
201
201
  import {
202
202
  layerJson,
203
- make3,
203
+ make4,
204
204
  withHeaders,
205
205
  layerProtocolSocket,
206
206
  ConnectionHooks
207
- } from "./chunk-1nxcn08k.js";
207
+ } from "./chunk-qkjfx2ts.js";
208
208
 
209
209
  // apps/cli/src/mcp.ts
210
210
  import { tmpdir as tmpdir2 } from "os";
@@ -1956,56 +1956,56 @@ var LivePresenceSubscriptionMessage = Union([
1956
1956
  LivePresenceSubscriptionUpdate
1957
1957
  ]);
1958
1958
 
1959
- class LiveRpcs extends make6(make5("Session", {
1959
+ class LiveRpcs extends make7(make6("Session", {
1960
1960
  success: Struct({ workspaceId: String4, clientKind: String4 }),
1961
1961
  error: LiveRpcError
1962
- }), make5("Subscribe", {
1962
+ }), make6("Subscribe", {
1963
1963
  payload: LiveSubscribeInput,
1964
1964
  success: LiveSubscriptionMessage,
1965
1965
  error: LiveRpcError,
1966
1966
  stream: true
1967
- }), make5("Replay", {
1967
+ }), make6("Replay", {
1968
1968
  payload: LiveReplayInput,
1969
1969
  success: ArraySchema(LiveEvent),
1970
1970
  error: LiveRpcError
1971
- }), make5("Ack", {
1971
+ }), make6("Ack", {
1972
1972
  payload: LiveAckInput,
1973
1973
  success: LiveAckResult,
1974
1974
  error: LiveRpcError
1975
- }), make5("SubscribeWeb", {
1975
+ }), make6("SubscribeWeb", {
1976
1976
  payload: LiveWebSubscribeInput,
1977
1977
  success: LiveWebSubscriptionMessage,
1978
1978
  error: LiveRpcError,
1979
1979
  stream: true
1980
- }), make5("SubscriptionStatus", {
1980
+ }), make6("SubscriptionStatus", {
1981
1981
  payload: { subscriptionId: String4 },
1982
1982
  success: LiveSubscriptionStatus,
1983
1983
  error: LiveRpcError
1984
- }), make5("ReplayWeb", {
1984
+ }), make6("ReplayWeb", {
1985
1985
  payload: LiveWebReplayInput,
1986
1986
  success: LiveWebReplayResult,
1987
1987
  error: LiveRpcError
1988
- }), make5("AckWeb", {
1988
+ }), make6("AckWeb", {
1989
1989
  payload: LiveWebAckInput,
1990
1990
  success: LiveWebAckResult,
1991
1991
  error: LiveRpcError
1992
- }), make5("PublishPresence", {
1992
+ }), make6("PublishPresence", {
1993
1993
  payload: LivePresencePublishInput,
1994
1994
  success: LivePresenceEntry,
1995
1995
  error: LiveRpcError
1996
- }), make5("SubscribePresence", {
1996
+ }), make6("SubscribePresence", {
1997
1997
  payload: LivePresenceSubscribeInput,
1998
1998
  success: LivePresenceSubscriptionMessage,
1999
1999
  error: LiveRpcError,
2000
2000
  stream: true
2001
- }), make5("ClearPresence", {
2001
+ }), make6("ClearPresence", {
2002
2002
  payload: { scope: optional(LiveScope) },
2003
2003
  error: LiveRpcError
2004
- }), make5("RecordSessionUpdate", {
2004
+ }), make6("RecordSessionUpdate", {
2005
2005
  payload: { sessionId: String4, input: SessionUpdateCreate },
2006
2006
  success: SessionUpdate,
2007
2007
  error: LiveRpcError
2008
- }), make5("EndSession", {
2008
+ }), make6("EndSession", {
2009
2009
  payload: { sessionId: String4, input: SessionEnd },
2010
2010
  success: Session,
2011
2011
  error: LiveRpcError
@@ -2043,7 +2043,7 @@ function connectKitmanLiveRoot(protocol) {
2043
2043
  const authenticate = async (input) => {
2044
2044
  close2();
2045
2045
  const brokenListeners = new Set;
2046
- const scope = makeUnsafe6();
2046
+ const scope = makeUnsafe5();
2047
2047
  let connected = false;
2048
2048
  const hooks = succeed5(ConnectionHooks)({
2049
2049
  onConnect: sync2(() => {
@@ -2057,7 +2057,7 @@ function connectKitmanLiveRoot(protocol) {
2057
2057
  })
2058
2058
  });
2059
2059
  const layer = (isString2(protocol) ? liveWebSocketProtocol(protocol) : protocol()).pipe(provideMerge(hooks));
2060
- const client = await runPromise(buildWithScope(layer, scope).pipe(flatMap3((context) => make3(LiveRpcs).pipe(provideContext2(context))), provide(scope)));
2060
+ const client = await runPromise(buildWithScope(layer, scope).pipe(flatMap3((context) => make4(LiveRpcs).pipe(provideContext2(context))), provide(scope)));
2061
2061
  let abandon = () => {};
2062
2062
  const abandoned = new Promise((_resolve, reject) => {
2063
2063
  abandon = reject;
@@ -2085,7 +2085,7 @@ function call(connection, effect) {
2085
2085
  }
2086
2086
  function openStream(connection, stream, isOpened, deliver) {
2087
2087
  return new Promise((resolve, reject) => {
2088
- const opened = makeUnsafe5();
2088
+ const opened = makeUnsafe4();
2089
2089
  const fiber = runFork(withHeaders2(connection, runForEach(stream, (message) => isOpened(message) ? succeed4(opened, message) : promise(() => deliver(message)))).pipe(mapError2(toError), tapError2((error) => fail5(opened, error)), ensuring2(fail5(opened, toError({ message: "Live subscription ended before it opened" }))), provide(connection.scope)));
2090
2090
  runPromise(_await(opened)).then((message) => resolve({
2091
2091
  opened: message,
@@ -2273,6 +2273,7 @@ var generatedOpenApiSchemas = {
2273
2273
  "2113130e4b2eb8a5": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","bindingId"],"properties":{"workspaceId":{"type":"string"},"bindingId":{"type":"string"}}}'),
2274
2274
  "21d0aedfbc688a03": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","projectId","input"],"properties":{"workspaceId":{"type":"string"},"projectId":{"type":"string"},"input":{"type":"object","properties":{"trigger":{"type":["string","null"],"enum":["merge","milestone","project"]}},"required":["trigger"],"additionalProperties":false}}}'),
2275
2275
  "2420a714ddb98c43": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","input"],"properties":{"workspaceId":{"type":"string"},"input":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":80},"teamId":{"type":"string"},"typeId":{"type":"string"},"loop":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":200},"body":{"type":"string","maxLength":20000},"acceptanceCriteria":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":50},"labelIds":{"type":"array","items":{"type":"string"}}},"required":["name"],"additionalProperties":true}}}'),
2276
+ "2494a5e35f1eb8f7": JSON.parse('{"type":"object","additionalProperties":false,"required":["teamId","input"],"properties":{"teamId":{"type":"string"},"input":{"type":"object","properties":{"defaultRepoBindingId":{"type":["string","null"],"minLength":1},"standardBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"epicBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"isolatedChildBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"delivery":{"type":"string","enum":["gated","auto"]},"hoursPerPriorityLevel":{"type":"integer","minimum":1,"maximum":168},"agentsStateScope":{"type":"boolean"},"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false}}}'),
2276
2277
  "24c769346fcba8ee": JSON.parse('{"type":"object","properties":{"removed":{"type":"boolean"}},"required":["removed"],"additionalProperties":false}'),
2277
2278
  "24e1ac5e89cd75b9": JSON.parse('{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":214,"pattern":"^(@[a-z0-9-~][a-z0-9-._~]*\\\\/)?[a-z0-9-~][a-z0-9-._~]*$"},"layer":{"type":"string","enum":["team","workspace"]},"teamId":{"type":"string","minLength":1},"current":{"type":"object","properties":{"number":{"type":"integer","minimum":1,"maximum":9007199254740991},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"protocolVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"provenance":{"type":"object","properties":{"repository":{"type":"string"},"commit":{"type":"string"},"clean":{"type":"boolean"}},"required":["clean"],"additionalProperties":false},"deployedByActorType":{"type":"string","enum":["human","delegated_agent","agent"]},"deployedByActorId":{"type":"string"},"deployBindingId":{"type":"string","minLength":1},"carried":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":214,"pattern":"^(@[a-z0-9-~][a-z0-9-._~]*\\\\/)?[a-z0-9-~][a-z0-9-._~]*$"},"version":{"type":"string"},"setup":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["name","version","setup"],"additionalProperties":false}},"deployedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["current","superseded","dev","removed"]}},"required":["number","digest","protocolVersion","provenance","deployedByActorType","deployedByActorId","deployedAt","status"],"additionalProperties":false},"loops":{"type":"array","items":{"type":"string"}},"agents":{"type":"array","items":{"type":"string"}},"versions":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer","minimum":1,"maximum":9007199254740991},"digest":{"type":"string","pattern":"^[a-f0-9]{64}$"},"protocolVersion":{"type":"integer","minimum":1,"maximum":9007199254740991},"provenance":{"type":"object","properties":{"repository":{"type":"string"},"commit":{"type":"string"},"clean":{"type":"boolean"}},"required":["clean"],"additionalProperties":false},"deployedByActorType":{"type":"string","enum":["human","delegated_agent","agent"]},"deployedByActorId":{"type":"string"},"deployBindingId":{"type":"string","minLength":1},"carried":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":214,"pattern":"^(@[a-z0-9-~][a-z0-9-._~]*\\\\/)?[a-z0-9-~][a-z0-9-._~]*$"},"version":{"type":"string"},"setup":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["name","version","setup"],"additionalProperties":false}},"deployedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["current","superseded","dev","removed"]}},"required":["number","digest","protocolVersion","provenance","deployedByActorType","deployedByActorId","deployedAt","status"],"additionalProperties":false}},"schedules":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"id":{"type":"string","minLength":1},"name":{"type":"string"}},"required":["key","id"],"additionalProperties":false}},"drift":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["schedule"]},"key":{"type":"string"},"field":{"type":"string"},"declared":{},"live":{},"changedBy":{"type":"object","properties":{"actorType":{"type":"string"},"actorId":{"type":"string"}},"required":["actorType","actorId"],"additionalProperties":false},"changedAt":{"type":"string","format":"date-time"}},"required":["kind","key","field","declared","live"],"additionalProperties":false}}},"required":["name","layer","loops","agents","versions","schedules","drift"],"additionalProperties":false}'),
2278
2279
  "25f6dd90044eeba7": JSON.parse('{"type":"object","additionalProperties":false,"required":["changeRequestId"],"properties":{"changeRequestId":{"type":"string"}}}'),
@@ -2448,7 +2449,6 @@ var generatedOpenApiSchemas = {
2448
2449
  "97ae329027451702": JSON.parse('{"type":"object","properties":{"id":{"type":"string","minLength":1},"workspaceId":{"type":"string","minLength":1},"taskId":{"type":"string","minLength":1},"sessionId":{"type":"string","minLength":1},"sourceSession":{"type":"object","properties":{"id":{"type":"string","minLength":1},"actorType":{"type":"string","enum":["human","delegated_agent","agent"]},"agentIdentityId":{"type":"string","minLength":1},"agentName":{"type":"string"},"runtimeProfile":{"type":"string"},"modelProvider":{"type":"string"},"modelName":{"type":"string"},"modelId":{"type":"string"},"startedAt":{"type":"string","format":"date-time"}},"required":["id","actorType","startedAt"],"additionalProperties":false},"replyToEntryId":{"type":"string","minLength":1},"kind":{"type":"string","enum":["note","question","answer","decision","blocker","finding","handoff","test_result","file_reference","status_change","assignment_change","link","change_request_review"]},"content":{"type":"string","minLength":1},"metadata":{"type":"object"},"actorType":{"type":"string","enum":["human","delegated_agent","agent"]},"actorId":{"type":"string","minLength":1},"delegatedByUserId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"reactions":{"type":"array","items":{"type":"object","properties":{"reaction":{"type":"string","enum":["thumbs_up","thumbs_down","heart","laugh","hooray","confused","eyes","rocket"]},"actors":{"type":"array","items":{"type":"object","properties":{"actorType":{"type":"string","enum":["human","delegated_agent","agent"]},"actorId":{"type":"string","minLength":1}},"required":["actorType","actorId"],"additionalProperties":false}}},"required":["reaction","actors"],"additionalProperties":false}}},"required":["id","workspaceId","taskId","kind","content","metadata","actorType","actorId","createdAt"],"additionalProperties":false}'),
2449
2450
  "97bbcfe64a1e312d": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","taskId","input"],"properties":{"workspaceId":{"type":"string"},"taskId":{"type":"string","description":"The Task: its id or any key it has had, such as `KIT-12`."},"input":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamId":{"type":"string"}},"required":["teamId"],"additionalProperties":true}}}'),
2450
2451
  "9849aa6871c44e79": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","input"],"properties":{"workspaceId":{"type":"string"},"input":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":80},"scope":{"type":"string","enum":["personal","team","workspace"]},"teamId":{"type":"string"},"query":{"type":"object","properties":{"filter":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["team"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["state"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["stateCategory"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string","enum":["triage","backlog","unstarted","started","completed","canceled","duplicate"]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["assignee"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"anyOf":[{"type":"string","enum":["me","none"]},{"type":"string"}]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["creator"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"anyOf":[{"type":"string","enum":["me"]},{"type":"string"}]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["priority"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string","enum":["none","urgent","high","medium","low"]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["labels"]},"op":{"type":"string","enum":["any","all","none"]},"value":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["repository"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"anyOf":[{"type":"string","enum":["none"]},{"type":"string"}]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["project"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"anyOf":[{"type":"string","enum":["none"]},{"type":"string"}]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["milestone"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"anyOf":[{"type":"string","enum":["none"]},{"type":"string"}]},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["parent"]},"op":{"type":"string","enum":["any","none"]},"negate":{"type":"boolean"}},"required":["field","op"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["parent"]},"op":{"type":"string","enum":["is"]},"value":{"type":"string"},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["type"]},"op":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["text"]},"op":{"type":"string","enum":["contains"]},"value":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":200},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["created","updated"]},"op":{"type":"string","enum":["between"]},"value":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"additionalProperties":true},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true},{"type":"object","properties":{"field":{"type":"string","enum":["run"]},"op":{"type":"string","enum":["is"]},"value":{"type":"string","enum":["active","needs_person","none"]},"negate":{"type":"boolean"}},"required":["field","op","value"],"additionalProperties":true}]},"maxItems":50}},"required":["match","conditions"],"additionalProperties":true},"grouping":{"type":"string","enum":["none","state","type","assignee","priority","repository","project","milestone"]},"ordering":{"type":"string","enum":["manual","priority","created","updated","key"]},"layout":{"type":"string","enum":["list","board"]},"includeTriage":{"type":"boolean"}},"required":["filter","grouping","ordering","layout","includeTriage"],"additionalProperties":true}},"required":["name","scope","query"],"additionalProperties":true}}}'),
2451
- "98560390c1ace987": JSON.parse('{"type":"object","properties":{"defaultRepoBindingId":{"type":"string","minLength":1},"standardBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"epicBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"isolatedChildBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"delivery":{"type":"string","enum":["gated","auto"]},"hoursPerPriorityLevel":{"type":"integer","minimum":1,"maximum":168},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["standardBranchTemplate","epicBranchTemplate","isolatedChildBranchTemplate","delivery","hoursPerPriorityLevel","revision"],"additionalProperties":false}'),
2452
2452
  "987dd799df75624b": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","repoBindingId","name"],"properties":{"workspaceId":{"type":"string"},"repoBindingId":{"type":"string"},"name":{"type":"string"}}}'),
2453
2453
  "99057071a31ecd6d": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","input"],"properties":{"workspaceId":{"type":"string"},"input":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":120},"description":{"type":"string"},"leadId":{"type":"string"},"status":{"type":"string","enum":["planned","active","paused","completed","canceled"]},"targetDate":{"type":"string"}},"required":["name"],"additionalProperties":true}}}'),
2454
2454
  "996611f15f70f2eb": JSON.parse('{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"resource":{"type":"string","pattern":"^[a-z0-9][a-z0-9._:-]*$","minLength":1,"maxLength":128},"runId":{"type":"string","minLength":1},"loopId":{"type":"string"},"runStatus":{"type":"string","enum":["pending","running","blocked","completed","failed","canceled","expired"]},"claimedAt":{"type":"string","format":"date-time"},"keptAt":{"type":"string","format":"date-time"},"keptReason":{"type":"string"},"waiting":{"type":"array","items":{"type":"string","minLength":1}}},"required":["resource","runId","loopId","runStatus","claimedAt","waiting"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}'),
@@ -2462,7 +2462,6 @@ var generatedOpenApiSchemas = {
2462
2462
  "9befb9220de5e308": JSON.parse('{"type":"object","additionalProperties":false,"required":["runnerId","input"],"properties":{"runnerId":{"type":"string"},"input":{"type":"object","properties":{"workUnitId":{"type":"string","minLength":1},"lease":{"type":"object","properties":{"leaseOwnerId":{"type":"string","minLength":1},"runnerReplicaId":{"type":"string","minLength":1},"leaseId":{"type":"string","minLength":1},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"fencingToken":{"type":"string","minLength":1,"maxLength":240,"pattern":"^[A-Za-z0-9._:-]+$"},"capacitySlot":{"type":"string","minLength":1,"maxLength":240}},"required":["leaseOwnerId","runnerReplicaId","leaseId","attempt","fencingToken","capacitySlot"],"additionalProperties":false},"crashed":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"],"additionalProperties":false},"tokens":{"anyOf":[{"type":"object","properties":{"input":{"type":"integer","minimum":0,"maximum":9007199254740991},"output":{"type":"integer","minimum":0,"maximum":9007199254740991},"cached":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["input","output","cached"],"additionalProperties":false},{"type":"string","enum":["none"]}]}},"required":["workUnitId","lease"],"additionalProperties":false}}}'),
2463
2463
  "9bf81e27f1f1ba85": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","repoBindingId","input"],"properties":{"workspaceId":{"type":"string"},"repoBindingId":{"type":"string"},"input":{"type":"object","properties":{"team":{"type":["string","null"],"minLength":1}},"required":["team"],"additionalProperties":false}}}'),
2464
2464
  "9c4d995fa9386db7": JSON.parse('{"type":"object","additionalProperties":false,"required":["decisionId"],"properties":{"decisionId":{"type":"string"}}}'),
2465
- "9d23f777fddbb804": JSON.parse('{"type":"object","additionalProperties":false,"required":["teamId","input"],"properties":{"teamId":{"type":"string"},"input":{"type":"object","properties":{"defaultRepoBindingId":{"type":["string","null"],"minLength":1},"standardBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"epicBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"isolatedChildBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"delivery":{"type":"string","enum":["gated","auto"]},"hoursPerPriorityLevel":{"type":"integer","minimum":1,"maximum":168},"expectedRevision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["expectedRevision"],"additionalProperties":false}}}'),
2466
2465
  "9d5b310e453e4043": JSON.parse('{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"workspaceId":{"type":"string","minLength":1},"runnerId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":160},"status":{"type":"string","enum":["active","draining","stopped","disabled"]},"healthStatus":{"type":"string","enum":["healthy","degraded","unhealthy","unknown"]},"drainState":{"type":"string","enum":["accepting","draining","drained"]},"capacity":{"type":"object","properties":{"maxConcurrentRuns":{"type":"number","minimum":1},"maxCpuCores":{"type":"number","minimum":1},"maxMemoryMb":{"type":"number","minimum":1},"maxRunSeconds":{"type":"number","minimum":1}},"additionalProperties":false},"cacheHints":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":240,"pattern":"^(?!\\\\/)(?!.*:\\\\/\\\\/)(?!.*\\\\\\\\)(?!.*\\\\s)(?!.*(?:^|\\\\/)\\\\.\\\\.?($|\\\\/))[A-Za-z0-9._:@/-]+$"},"sharing":{"type":"string","enum":["runner","replica","workspace"]},"warmed":{"type":"boolean"},"cacheClass":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9._:-]+$"},"developmentEnvironmentHash":{"type":"string","minLength":32,"maxLength":64,"pattern":"^[a-fA-F0-9]{64}$"},"agentEnvironmentHash":{"type":"string","minLength":32,"maxLength":64,"pattern":"^[a-fA-F0-9]{64}$"},"sandboxPolicyHash":{"type":"string","minLength":32,"maxLength":64,"pattern":"^[a-fA-F0-9]{64}$"},"secretScopeHash":{"type":"string","minLength":32,"maxLength":64,"pattern":"^[a-fA-F0-9]{64}$"},"cacheState":{"type":"string","enum":["hit","miss","stale","corrupt","lock_wait","invalidated"]}},"required":["key","sharing","warmed"],"additionalProperties":false}},"placement":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":80},"label":{"type":"string","minLength":1,"maxLength":160},"zone":{"type":"string","minLength":1,"maxLength":160}},"required":["kind"],"additionalProperties":false},"telemetry":{"type":"object","properties":{"activeWorkUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"queuedWorkUnits":{"type":"integer","minimum":0,"maximum":9007199254740991},"cacheHitRate":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":false},"lastHeartbeatAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","workspaceId","runnerId","name","status","healthStatus","drainState","capacity","cacheHints","telemetry","createdAt","updatedAt"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}'),
2467
2466
  "9daa8a9aff4917b8": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId"],"properties":{"workspaceId":{"type":"string","minLength":1},"options":{"type":"object","additionalProperties":false,"properties":{"limit":{"anyOf":[{"type":"number"},{"type":"string"}],"multipleOf":1,"minimum":1,"maximum":100},"cursor":{"type":"string","minLength":1,"maxLength":512}}}}}'),
2468
2467
  "9e5be89e00911910": JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","projectId","input"],"properties":{"workspaceId":{"type":"string"},"projectId":{"type":"string"},"input":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^\\\\S[\\\\s\\\\S]*\\\\S$|^\\\\S$|^$","minLength":1,"maxLength":120},"description":{"type":"string"},"leadId":{"type":["string","null"]},"status":{"type":"string","enum":["planned","active","paused","completed","canceled"]},"targetDate":{"type":["string","null"]},"visibility":{"type":"string","enum":["workspace","private"]}},"additionalProperties":true}}}'),
@@ -2562,6 +2561,7 @@ var generatedOpenApiSchemas = {
2562
2561
  d43dbe22c50735a6: JSON.parse('{"type":"object","additionalProperties":false,"required":["taskId","input"],"properties":{"taskId":{"type":"string","description":"The Task: its id or any key it has had, such as `KIT-12`."},"input":{"type":"object","properties":{"kind":{"type":"string","enum":["note","question","answer","decision","blocker","finding","handoff","test_result","file_reference","status_change","assignment_change","link","change_request_review"]},"content":{"type":"string","minLength":1},"replyToEntryId":{"type":"string","minLength":1},"sessionId":{"type":"string","minLength":1},"metadata":{"type":"object"}},"required":["kind","content"],"additionalProperties":false}}}'),
2563
2562
  d452082a06ab5d01: JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","projectId"],"properties":{"workspaceId":{"type":"string"},"projectId":{"type":"string"},"options":{"type":"object","additionalProperties":false,"properties":{"teamId":{"type":"string"}}}}}'),
2564
2563
  d47c5c5993120979: JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","input"],"properties":{"workspaceId":{"type":"string"},"input":{"type":"object","properties":{"days":{"type":["integer","null"],"minimum":1,"maximum":9007199254740991}},"required":["days"],"additionalProperties":false}}}'),
2564
+ d565eb30a74abd5b: JSON.parse('{"type":"object","properties":{"defaultRepoBindingId":{"type":"string","minLength":1},"standardBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"epicBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"isolatedChildBranchTemplate":{"type":"string","minLength":1,"maxLength":160},"delivery":{"type":"string","enum":["gated","auto"]},"hoursPerPriorityLevel":{"type":"integer","minimum":1,"maximum":168},"agentsStateScope":{"type":"boolean"},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["standardBranchTemplate","epicBranchTemplate","isolatedChildBranchTemplate","delivery","hoursPerPriorityLevel","agentsStateScope","revision"],"additionalProperties":false}'),
2565
2565
  d5afb090a9ae987f: JSON.parse('{"type":"object","properties":{"id":{"type":"string","minLength":1},"workspaceId":{"type":"string","minLength":1},"scopeType":{"type":"string","enum":["workspace","repository","loop","kit","team","task"]},"scopeId":{"type":"string","minLength":1},"content":{"type":"string","minLength":1,"maxLength":10000},"status":{"type":"string","enum":["proposed","accepted","rejected","deprecated"]},"confidence":{"type":"string","enum":["low","medium","high"]},"sourceType":{"type":"string","enum":["user","agent","session","context_pack","run"]},"sourceId":{"type":"string","minLength":1},"createdByActorType":{"type":"string","enum":["human","delegated_agent","agent"]},"createdByActorId":{"type":"string","minLength":1},"approvedByUserId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","workspaceId","scopeType","scopeId","content","status","confidence","createdByActorType","createdByActorId","createdAt","updatedAt"],"additionalProperties":false}'),
2566
2566
  d5cd425c5bb37bcb: JSON.parse('{"type":"object","additionalProperties":false,"required":["workspaceId","taskIdOrKey","input"],"properties":{"workspaceId":{"type":"string"},"taskIdOrKey":{"type":"string"},"input":{"type":"object","properties":{"loop":{"type":"string","minLength":1,"maxLength":120},"overrideBlockers":{"type":"boolean"}},"required":["loop"],"additionalProperties":false}}}'),
2567
2567
  d6c0cf8cc888455c: JSON.parse('{"type":"object","properties":{"id":{"type":"string","minLength":1},"workspaceId":{"type":"string","minLength":1},"taskId":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"url":{"type":"string","minLength":1},"title":{"type":"string"},"provider":{"type":"string"},"externalId":{"type":"string"},"metadata":{"type":"object"},"createdByActorType":{"type":"string","enum":["human","delegated_agent","agent"]},"createdByActorId":{"type":"string","minLength":1},"createdAt":{"type":"string","format":"date-time"}},"required":["id","workspaceId","taskId","kind","url","metadata","createdByActorType","createdByActorId","createdAt"],"additionalProperties":false}'),
@@ -2728,7 +2728,7 @@ var generatedOpenApiOperationContracts = {
2728
2728
  getTaskAssetDownloadUrl: { inputSchemaId: "ca3740c8616abdf4", outputSchemaId: "6a7fec9ab19a1677" },
2729
2729
  getTaskExecutionRecord: { inputSchemaId: "8ac901573072021d", outputSchemaId: "9f64bd155181b75f" },
2730
2730
  getTeam: { inputSchemaId: "9b4b1d8280129ef9", outputSchemaId: "706c8c03a6431f03" },
2731
- getTeamDeliverySettings: { inputSchemaId: "fc99a2a80b97a8b2", outputSchemaId: "98560390c1ace987" },
2731
+ getTeamDeliverySettings: { inputSchemaId: "fc99a2a80b97a8b2", outputSchemaId: "d565eb30a74abd5b" },
2732
2732
  getTeamDeliveryTarget: { inputSchemaId: "fc99a2a80b97a8b2", outputSchemaId: "090f8a8cb18bbfad" },
2733
2733
  getTeamReleaseTrigger: { inputSchemaId: "fc99a2a80b97a8b2", outputSchemaId: "99fd651cae8dcad1" },
2734
2734
  getTeamTask: { inputSchemaId: "c5273a7bc295286e", outputSchemaId: "b69fc58e9f6c827e" },
@@ -2937,7 +2937,7 @@ var generatedOpenApiOperationContracts = {
2937
2937
  updateTaskTemplate: { inputSchemaId: "b4519c90307c489c", outputSchemaId: "6fbd2b18391b5fe0" },
2938
2938
  updateTaskType: { inputSchemaId: "a238577cdcf52564", outputSchemaId: "beedd18878e4633d" },
2939
2939
  updateTeam: { inputSchemaId: "b56d458937ac19c4", outputSchemaId: "706c8c03a6431f03" },
2940
- updateTeamDeliverySettings: { inputSchemaId: "9d23f777fddbb804", outputSchemaId: "98560390c1ace987" },
2940
+ updateTeamDeliverySettings: { inputSchemaId: "2494a5e35f1eb8f7", outputSchemaId: "d565eb30a74abd5b" },
2941
2941
  updateTriageRule: { inputSchemaId: "38775bffeb1b661b", outputSchemaId: "1c88d235cae8e504" },
2942
2942
  updateWorkflowState: { inputSchemaId: "f78ee3b13cb8c506", outputSchemaId: "706c8c03a6431f03" },
2943
2943
  updateWorkspace: { inputSchemaId: "2cfef3fd6c0dbad6", outputSchemaId: "83567d1d5cb4da04" },
@@ -3448,7 +3448,7 @@ var operationSpecs = [
3448
3448
  parameters: ["workspaceId", "input"],
3449
3449
  namespacePath: ["teamTasks", "create"],
3450
3450
  tags: ["tasks"],
3451
- summary: "Make a Task in a Team, in the Team's default state unless `stateId` says otherwise. `promise` is one sentence that says what is true once it is done, and `outOfScope` lists the cases it does not handle. Read `skills({ name: 'scope-tasks' })` first; it says how to scope a Task, and how to file two or more related ones."
3451
+ summary: "Make a Task in a Team, in the Team's default state unless `stateId` says otherwise. `promise` is one sentence that says what is true once it is done, and `outOfScope` lists the cases it does not handle. Read `skills({ name: 'scope-tasks' })` first; it says how to scope a Task, and how to file two or more related ones. A Team can refuse an agent's Task without a `promise`."
3452
3452
  },
3453
3453
  {
3454
3454
  name: "getTeamTask",
@@ -5365,7 +5365,7 @@ process.stdin.on('data', chunk => {
5365
5365
  var bootGuest = gen(function* () {
5366
5366
  const assets = yield* codeModeAssets;
5367
5367
  const nonce = yield* (yield* SecureRandom).uuidV4();
5368
- const result = makeUnsafe5();
5368
+ const result = makeUnsafe4();
5369
5369
  let call = () => Promise.reject(new Error("Code Mode guest has no execution"));
5370
5370
  yield* sweepStaleSidecarTemp;
5371
5371
  const fs = yield* FileSystem;
@@ -5456,12 +5456,12 @@ var takeGuest = suspend3(() => {
5456
5456
  expireWhenIdle(booting);
5457
5457
  return join(taken);
5458
5458
  });
5459
- var outcomeOf = (warm) => raceFirst(map8(_await(warm.result), (text) => ({ text })), tryPromise({
5459
+ var outcomeOf = (warm) => raceFirst(map7(_await(warm.result), (text) => ({ text })), tryPromise({
5460
5460
  try: () => warm.guest.wait(),
5461
5461
  catch: (error) => new CodeModeExecutionError({
5462
5462
  message: `Code Mode secure-exec failed: ${error instanceof Error ? error.message : "unknown error"}`
5463
5463
  })
5464
- }).pipe(flatMap3((exitCode) => exitCode === 0 ? _await(warm.result).pipe(timeoutOrElse({ duration: millis(100), orElse: () => succeed6("{}") }), map8((text) => ({ text }))) : succeed6({ exitCode }))));
5464
+ }).pipe(flatMap3((exitCode) => exitCode === 0 ? _await(warm.result).pipe(timeoutOrElse({ duration: millis(100), orElse: () => succeed6("{}") }), map7((text) => ({ text }))) : succeed6({ exitCode }))));
5465
5465
  var executeCodeMode = fnUntraced(function* (input, options) {
5466
5466
  const startedAt = yield* currentTimeMillis;
5467
5467
  const codeHash = digestSha256(input.code, "hex");
@@ -5479,7 +5479,7 @@ var executeCodeMode = fnUntraced(function* (input, options) {
5479
5479
  return yield* new CodeModeExecutionError({
5480
5480
  message: `Code Mode secure-exec failed with exit code ${outcome.exitCode}`
5481
5481
  });
5482
- const returned = yield* decodeJsonString(outcome.text).pipe(map8((json) => isJsonObject(json) ? json : {}), mapError2(() => new CodeModeExecutionError({ message: "Code Mode secure-exec returned an unreadable result" })));
5482
+ const returned = yield* decodeJsonString(outcome.text).pipe(map7((json) => isJsonObject(json) ? json : {}), mapError2(() => new CodeModeExecutionError({ message: "Code Mode secure-exec returned an unreadable result" })));
5483
5483
  if (isString2(returned.thrown))
5484
5484
  return yield* new CodeModeExecutionError({ message: `Code Mode code threw ${returned.thrown}` });
5485
5485
  const finishedAt = yield* currentTimeMillis;
@@ -5747,10 +5747,59 @@ function compactOperationDescriptor(operation) {
5747
5747
  };
5748
5748
  }
5749
5749
 
5750
+ // packages/core/src/scope-tasks.generated.ts
5751
+ var scopeTasksText = `# Scope a Task
5752
+
5753
+ How to scope a Task, so an agent can build it in one session and a review of it ends.
5754
+
5755
+ Read this before you create a Task or write a plan's ticket.
5756
+
5757
+ ## One Promise per Task
5758
+
5759
+ - Give a Task one Promise: one sentence that says what is true once it is done. Write it in the Task's \`promise\`. Two Promises are two Tasks.
5760
+ - A Promise is open-ended when it covers cases nobody can list, such as every path, any input or all source code. Reviews of it keep finding one more case. Split it into a first Task with a bounded case, whose cases you list, and later Tasks that each widen it.
5761
+ - Size a Task to fit one agent session under 200k tokens of context, from reading the code to a verified change. Split one that does not fit.
5762
+
5763
+ ## What to write
5764
+
5765
+ - **Decisions:** make every design decision yourself, or ask the person. Leave none to the implementer.
5766
+ - **Interfaces:** name the operations, types, settings or pages the Task adds or changes, and how each behaves.
5767
+ - **Cases:** list the cases it handles, with the failures, and what happens in each.
5768
+ - **Tests:** name what a test must show, and where the tests go. Make each Acceptance Criterion something a reviewer can check against the change.
5769
+ - **Where to start:** name the modules, documents and decisions to read first.
5770
+ - **Out of scope:** list the cases the Task does not handle. When the Promise is open-ended, list them in \`outOfScope\`.
5771
+ - **Blockers:** name the Tasks whose code it needs, and relate them as blockers.
5772
+
5773
+ Write no code and no line numbers: both are out of date before the Task is built. Name things by what they are called.
5774
+
5775
+ ## Two or more related Tasks
5776
+
5777
+ Start the **File Tasks** Loop instead of creating related Tasks one by one. It makes a Task of each ticket and relates their blockers, so none is picked up before the Tasks it needs. In Code Mode:
5778
+
5779
+ \`\`\`js
5780
+ await kitman.runs.start({
5781
+ workspaceId,
5782
+ teamId,
5783
+ loop: 'file-tasks',
5784
+ input: {
5785
+ tickets: [
5786
+ { key: 'first', title: '\u2026', body: '\u2026', acceptanceCriteria: ['\u2026'], blockedBy: [] },
5787
+ { key: 'wider', title: '\u2026', body: '\u2026', acceptanceCriteria: ['\u2026'], blockedBy: ['first'] }
5788
+ ]
5789
+ }
5790
+ })
5791
+ \`\`\`
5792
+
5793
+ From a terminal, pass the same Input to \`kitman run start file-tasks --input '<json>'\`. Add \`projectId\` to the Input to file them in a Project. In a Plan Run, write the tickets in the plan: Plan files them.
5794
+ `;
5795
+
5750
5796
  // apps/mcp/src/result.ts
5751
5797
  var SummaryFieldMaxLength = 120;
5752
5798
  var ErrorMessageMaxLength = 500;
5753
5799
  var NestedTextMaxLength = 2000;
5800
+ var scopeGuideSuffix = `
5801
+
5802
+ ${scopeTasksText}`;
5754
5803
  var TaskKeyPattern = /^[A-Z][A-Z0-9]{1,6}-[1-9][0-9]*$/;
5755
5804
  function formatMcpToolSuccess(capability, output) {
5756
5805
  const safeOutput = preserveExecutionPauseMetadata(output, redactResponseSurface(output));
@@ -5792,7 +5841,7 @@ function slimNested(value, workspaceId) {
5792
5841
  }));
5793
5842
  }
5794
5843
  function cutText(value) {
5795
- if (value.length <= NestedTextMaxLength)
5844
+ if (value.length <= NestedTextMaxLength || value.endsWith(scopeGuideSuffix))
5796
5845
  return value;
5797
5846
  return `${value.slice(0, NestedTextMaxLength)}\u2026[cut ${value.length - NestedTextMaxLength} characters; return this field on its own or call execute with full: true]`;
5798
5847
  }
@@ -6009,7 +6058,7 @@ function createCodeModeHost(options) {
6009
6058
  const dispatchPrepared = fnUntraced(function* (operationName, preparedArgs, descriptor) {
6010
6059
  const startedAt = yield* currentTimeMillis;
6011
6060
  const backend = options.dispatchOperation ?? options.executeCapability ?? (() => fail7(new McpToolInputError({ message: "Kitman Code Mode dispatch is not configured." })));
6012
- return yield* backend(operationName, preparedArgs).pipe(tap2((output) => validateOperationOutput(descriptor, output)), tap2((output) => currentTimeMillis.pipe(map8((now) => calls.push({ operationName, status: "ok", durationMs: now - startedAt, resourceIds: resourceIds(output) })))), tapError2(() => currentTimeMillis.pipe(map8((now) => calls.push({ operationName, status: "error", durationMs: now - startedAt })))));
6061
+ return yield* backend(operationName, preparedArgs).pipe(tap2((output) => validateOperationOutput(descriptor, output)), tap2((output) => currentTimeMillis.pipe(map7((now) => calls.push({ operationName, status: "ok", durationMs: now - startedAt, resourceIds: resourceIds(output) })))), tapError2(() => currentTimeMillis.pipe(map7((now) => calls.push({ operationName, status: "error", durationMs: now - startedAt })))));
6013
6062
  });
6014
6063
  const dispatch = fnUntraced(function* (operationName, args) {
6015
6064
  const { descriptor, preparedArgs } = yield* prepareArgs(operationName, args);
@@ -6237,9 +6286,11 @@ function unwrapCallEnvelopes(value) {
6237
6286
  return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, unwrapCallEnvelopes(item)]));
6238
6287
  }
6239
6288
  function safeToolError(error) {
6289
+ const message = error.message.length > 0 ? sanitizeErrorMessage2(error.message) : "Kitman operation failed.";
6290
+ const scopeMissing = error instanceof KitmanClientError && error.code === "TaskScopeMissing";
6240
6291
  return {
6241
6292
  code: error.name.length > 0 ? error.name : "kitman_operation_error",
6242
- message: error.message.length > 0 ? sanitizeErrorMessage2(error.message) : "Kitman operation failed."
6293
+ message: scopeMissing ? `${message}${scopeGuideSuffix}` : message
6243
6294
  };
6244
6295
  }
6245
6296
  function sanitizeErrorMessage2(value) {
@@ -6307,17 +6358,10 @@ How Kitman works, such as Kits, Agents and their layers (\`extends\`, \`harness\
6307
6358
  - Credentials, bearer tokens, private keys, raw auth stores, env, filesystem, and child processes are not available in the sandbox.
6308
6359
  - Routine reads and work-loop updates should not pause. Destructive, authority-expanding, governance, and external-delivery operations may pause for approval.
6309
6360
  `;
6310
- var guideBody = (path) => {
6311
- const guide = readDoc2({ path });
6312
- return "text" in guide ? `# ${guide.title}
6313
-
6314
- ${guide.text}
6315
- ` : guide.error.message;
6316
- };
6317
6361
  var scopeTasksSkill = {
6318
6362
  name: "scope-tasks",
6319
6363
  summary: "How to scope a Task. Read it before you create a Task or write a ticket.",
6320
- body: guideBody("scope-tasks")
6364
+ body: scopeTasksText
6321
6365
  };
6322
6366
  var CodeModeSkills = [
6323
6367
  {
@@ -6479,7 +6523,7 @@ function createCodeModeExecutionStore(options = {}) {
6479
6523
  ...input.content === undefined ? undefined : { content: input.content }
6480
6524
  });
6481
6525
  });
6482
- const listForActor = (actorDigest) => sweep.pipe(map8(() => [...entries.values()].flatMap((entry) => entry.approvalActorDigest === actorDigest && entry.status === "paused" ? [inspection(entry)] : [])));
6526
+ const listForActor = (actorDigest) => sweep.pipe(map7(() => [...entries.values()].flatMap((entry) => entry.approvalActorDigest === actorDigest && entry.status === "paused" ? [inspection(entry)] : [])));
6483
6527
  const markUnknown = (input) => {
6484
6528
  const entry = entries.get(input.executionId);
6485
6529
  if (entry === undefined || entry.ownerDigest !== ownerDigest(input.owner))
@@ -6489,7 +6533,7 @@ function createCodeModeExecutionStore(options = {}) {
6489
6533
  markUnknownEntry(entry, input.reason);
6490
6534
  return true;
6491
6535
  };
6492
- const inspect = (executionId) => sweep.pipe(map8(() => {
6536
+ const inspect = (executionId) => sweep.pipe(map7(() => {
6493
6537
  const entry = entries.get(executionId);
6494
6538
  return entry === undefined ? undefined : inspection(entry);
6495
6539
  }));
@@ -6512,7 +6556,7 @@ function createCodeModeExecutionStore(options = {}) {
6512
6556
  entry.onDecision = undefined;
6513
6557
  }
6514
6558
  function settle(entry, result) {
6515
- return currentTimeMillis.pipe(map8((now) => {
6559
+ return currentTimeMillis.pipe(map7((now) => {
6516
6560
  entry.status = "settled";
6517
6561
  entry.settledResult = result;
6518
6562
  entry.settledUntilMs = now + settledReplayTtlMs;
@@ -6522,7 +6566,7 @@ function createCodeModeExecutionStore(options = {}) {
6522
6566
  }));
6523
6567
  }
6524
6568
  function settledResume(entry, input) {
6525
- return currentTimeMillis.pipe(map8((now) => {
6569
+ return currentTimeMillis.pipe(map7((now) => {
6526
6570
  if (entry.settledResult === undefined || entry.settledUntilMs === undefined || now >= entry.settledUntilMs) {
6527
6571
  entry.status = "expired";
6528
6572
  entry.settledResult = undefined;
@@ -6537,7 +6581,7 @@ function createCodeModeExecutionStore(options = {}) {
6537
6581
  }
6538
6582
  }
6539
6583
  function isoString(epochMillis) {
6540
- return formatIso(makeUnsafe(epochMillis));
6584
+ return formatIso(makeUnsafe6(epochMillis));
6541
6585
  }
6542
6586
  function pauseValue(entry, ttlMs) {
6543
6587
  return {
@@ -6899,7 +6943,7 @@ function registerCodeModeTools(server, options = {}) {
6899
6943
  const resolveDecision = (id) => options.resolveExecutionDecision?.({ executionId: id, owner }) ?? undefined_;
6900
6944
  if (executionId === undefined) {
6901
6945
  const paused = yield* executionStore.listForActor(owner.approvalActorDigest ?? owner.actorDigest);
6902
- const decided = yield* forEach(paused, (execution) => resolveDecision(execution.executionId).pipe(map8((decision) => ({ execution, action: decision }))), { concurrency: "unbounded" });
6946
+ const decided = yield* forEach(paused, (execution) => resolveDecision(execution.executionId).pipe(map7((decision) => ({ execution, action: decision }))), { concurrency: "unbounded" });
6903
6947
  const resumable = decided.filter((candidate) => candidate.action !== undefined);
6904
6948
  if (resumable.length === 1) {
6905
6949
  executionId = resumable[0]?.execution.executionId;
@@ -8357,7 +8401,7 @@ function registerStepTools(server, adapt, input) {
8357
8401
  description: "Read the brief for the Step you are working on: its instructions, Context Pack and Output schema. A long brief comes in pages; each names the offset of the next.",
8358
8402
  inputSchema: adapt(StepBriefArguments),
8359
8403
  annotations: { readOnlyHint: true, idempotentHint: true }
8360
- }, (args) => run(map8(request("/brief"), (brief) => text(briefPage(brief.prompt, isNumber2(args.offset) ? args.offset : 0)))));
8404
+ }, (args) => run(map7(request("/brief"), (brief) => text(briefPage(brief.prompt, isNumber2(args.offset) ? args.offset : 0)))));
8361
8405
  const closed = (question) => gen(function* () {
8362
8406
  let current = question;
8363
8407
  const interval = fromInputUnsafe(input.answerPollInterval ?? "2 seconds");
@@ -8392,7 +8436,7 @@ function registerStepTools(server, adapt, input) {
8392
8436
  structuredContent: result
8393
8437
  });
8394
8438
  case "parked":
8395
- return map8(closed(result.question), (question) => ({
8439
+ return map7(closed(result.question), (question) => ({
8396
8440
  ...failure(question.answer === undefined ? `Output refused again: ${result.message}. The Question it put to a person was closed without an answer (${question.status}). Stop working.` : `Output refused again: ${result.message}. Your Step waited for a person, who answered: \u201C${question.answer.value}\u201D Correct the Output as they say and submit it again; you have one more submission and one repair.`),
8397
8441
  structuredContent: { ...result, question }
8398
8442
  }));
@@ -8405,11 +8449,11 @@ function registerStepTools(server, adapt, input) {
8405
8449
  inputSchema: adapt(SessionUpdateArguments),
8406
8450
  outputSchema: adapt(AnyResult),
8407
8451
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }
8408
- }, (args) => run(map8(request("/session-updates", {
8452
+ }, (args) => run(map7(request("/session-updates", {
8409
8453
  kind: isString2(args.kind) ? args.kind : "progress",
8410
8454
  content: isString2(args.content) ? args.content : ""
8411
8455
  }), (result) => ({ content: [{ type: "text", text: "SessionUpdate recorded." }], structuredContent: result }))));
8412
- const answerOf = (question) => map8(closed(question), (current) => current.answer === undefined ? failure(`The Question was closed without an answer (${current.status}). Stop and submit what you have.`) : {
8456
+ const answerOf = (question) => map7(closed(question), (current) => current.answer === undefined ? failure(`The Question was closed without an answer (${current.status}). Stop and submit what you have.`) : {
8413
8457
  content: [
8414
8458
  { type: "text", text: encodeJsonStringSync({ answer: current.answer.value, questionId: current.id }) }
8415
8459
  ],
@@ -8434,7 +8478,7 @@ function registerStepTools(server, adapt, input) {
8434
8478
  const fitting = input.fittingSkills ?? [];
8435
8479
  const rank = (name) => fitting.includes(name) ? fitting.indexOf(name) : fitting.length;
8436
8480
  const names = (yield* fs.readDirectory(skillsDir).pipe(orElseSucceed(() => []))).toSorted((a, b) => rank(a) - rank(b) || a.localeCompare(b));
8437
- return yield* forEach(names, (name) => fs.readFileString(`${skillsDir}/${name}/SKILL.md`).pipe(map8((skill) => [
8481
+ return yield* forEach(names, (name) => fs.readFileString(`${skillsDir}/${name}/SKILL.md`).pipe(map7((skill) => [
8438
8482
  {
8439
8483
  name,
8440
8484
  description: skillDescription(skill),
@@ -8442,9 +8486,9 @@ function registerStepTools(server, adapt, input) {
8442
8486
 
8443
8487
  The skill's directory, for the files it points to: ${skillsDir}/${name}`
8444
8488
  }
8445
- ]), orElseSucceed(() => []))).pipe(map8((found) => found.flat()));
8489
+ ]), orElseSucceed(() => []))).pipe(map7((found) => found.flat()));
8446
8490
  });
8447
- const loadable = map8(kitSkills, (skills) => skills.some(({ name }) => name === scopeTasksSkill.name) ? skills : [
8491
+ const loadable = map7(kitSkills, (skills) => skills.some(({ name }) => name === scopeTasksSkill.name) ? skills : [
8448
8492
  ...skills,
8449
8493
  { name: scopeTasksSkill.name, description: scopeTasksSkill.summary, body: scopeTasksSkill.body.trim() }
8450
8494
  ]);
@@ -8452,7 +8496,7 @@ The skill's directory, for the files it points to: ${skillsDir}/${name}`
8452
8496
  description: "List the Run's skills you can load with no name, or load one by name; a second load answers that it is already in your context unless you pass reload: true after compaction.",
8453
8497
  inputSchema: adapt(SkillsArguments),
8454
8498
  annotations: { readOnlyHint: true, idempotentHint: false }
8455
- }, (args) => runMcpEffect(map8(loadable, (skills) => {
8499
+ }, (args) => runMcpEffect(map7(loadable, (skills) => {
8456
8500
  const name = isString2(args.name) ? args.name : undefined;
8457
8501
  if (name === undefined)
8458
8502
  return text(skills.map((found) => `- ${found.name}: ${found.description}`).join(`