elanous 0.2.41 → 0.2.43
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/apps/pwa/out/404/index.html +1 -1
- package/apps/pwa/out/404.html +1 -1
- package/apps/pwa/out/_next/static/{GiOLWmt4MqDZePubBjA4Q → Om5xS9jpjSXJCeTNGYEi4}/_buildManifest.js +1 -1
- package/apps/pwa/out/_next/static/chunks/{2fe2c302.41b517f88d6fe502.js → 0966f8a1.745fcd44f64a87ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{385e4574.e9886ab32759eda3.js → 0ad6802e.ae7afb63fdcb4491.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/114.2b90424d1a3ce84c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1151-5c2bb8f002ca2dd6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1200.6a37c202f9f17e9a.js +226 -0
- package/apps/pwa/out/_next/static/chunks/1261-a616d5728e02e624.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1313-19f737e0222c4444.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1357.3bbef3976c37f94a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1362-20adddfaf662b0fa.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{6874.d5cf7eb8edb2cabe.js → 1406.a1dc2ab6f8449374.js} +2 -2
- package/apps/pwa/out/_next/static/chunks/1737-9491fc6ab29b9ec6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1803-4f91a8e7dcaf042c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5744.b9415e18ad623100.js → 1961.a81b12872c3e93a9.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/1970cf59.2d4d8ce5d6c81853.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1971-8890f3962ba7ee0a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/2073-ba274e00e4f9efb4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5471.1e611302ed3a7c53.js → 2144.25b292396712196d.js} +2 -2
- package/apps/pwa/out/_next/static/chunks/{3230-49298c3b73ef2268.js → 2268-53861f339e0b65a2.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{9834.63ab2bbc3153172e.js → 2312.0c8b61e22d3136d7.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{1800.f7ff51dc4978a958.js → 2573.387a707f6f9d720c.js} +2 -2
- package/apps/pwa/out/_next/static/chunks/273.f156eee28f11af77.js +1 -0
- package/apps/pwa/out/_next/static/chunks/2873.d2140e5a82546401.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{9048.212083de42d25be3.js → 3072.01338851ca21a6f7.js} +2 -2
- package/apps/pwa/out/_next/static/chunks/3091.a5a4143dea33d197.js +90 -0
- package/apps/pwa/out/_next/static/chunks/3095.dc44586a5f83b86d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{2263.e09b6edea33bad2d.js → 3113.d7472bbc27d580c7.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/3228-9650b6447b6fa288.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3402.44b565b314f2263c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{addc2b32.8c4ff8f0aefe987d.js → 3557ac4a.c8931684475018ad.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/360.ae9f9f4c33c395e8.js +79 -0
- package/apps/pwa/out/_next/static/chunks/3638.80412ea63aae8f3f.js +286 -0
- package/apps/pwa/out/_next/static/chunks/{a0a01613.6d1cca322238d7fe.js → 363bfab3.9623b9f89363541f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/3694.e0099884345f0198.js +64 -0
- package/apps/pwa/out/_next/static/chunks/3744.54f87db52acfd1ab.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3903.3ef4656c67572764.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3935.16701e33f8982dc9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3955.6922286237f2ac2b.js +24 -0
- package/apps/pwa/out/_next/static/chunks/3969.272ee7f9fd6c62e5.js +34 -0
- package/apps/pwa/out/_next/static/chunks/4199.ce86b281fd0a60b7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4311-6dd3144002cc0c2d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4426-2b230fad00c88930.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{530.d26346e18089640a.js → 4445.7990c76b3751a918.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/4447-14c5161fa59166c7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4856-b0b8075bba8c53f4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4870-de370d65e73c0bb5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4885-2c989165c4b29fad.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4894.fec2ca9e99caefa2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5093.8f04b7f8cb899a95.js +94 -0
- package/apps/pwa/out/_next/static/chunks/5122-2bb177cebf89e19a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5154.5f56dc3902e3d275.js +36 -0
- package/apps/pwa/out/_next/static/chunks/529.64ff7257180b2ac9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5394.5dabeb0c62293a28.js +93 -0
- package/apps/pwa/out/_next/static/chunks/5461.08bf2404ff38ec85.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5474-22e08a85583209b2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{1219.7e17964e0e7cd8e5.js → 5564.9e72532188f57586.js} +3 -3
- package/apps/pwa/out/_next/static/chunks/5567-265df39ed8fe9dcb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5570-a94ae19811cb2046.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5574-b47c9ef2dceff1fd.js +1 -0
- package/apps/pwa/out/_next/static/chunks/5628.6ddb2d5ffba4ff4c.js +309 -0
- package/apps/pwa/out/_next/static/chunks/5730.43d7ccc09988e646.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{1178.1aa9cad0e7695427.js → 5789.2da35c258292e1e5.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{4133.2056bb4d78f621af.js → 5824.da9527b15a3221e5.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/5866.366966af47fdde5d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{4527.a69f2894d1bc9f4a.js → 5930.8b4df3b46c32b05a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/5963-c4d8469c52a0828b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6001.ec4049ceb3c43418.js +27 -0
- package/apps/pwa/out/_next/static/chunks/6120-471f03db1e299c0c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6175-41479e643aca1878.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6291.a2de4f9787637075.js +104 -0
- package/apps/pwa/out/_next/static/chunks/6400-6699907c3537436a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6428.1f4327d6ae5fdf9a.js +287 -0
- package/apps/pwa/out/_next/static/chunks/644.02cb026fa44bcd0a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6466-6c87d60d3dd174fb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{9507.7026657a2f47eb64.js → 6540.c7bef57ad8f90a87.js} +16 -16
- package/apps/pwa/out/_next/static/chunks/6773.d4264665ab31bec0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6822.3c789f1a8443e774.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5574.f35accf4f132b29d.js → 6944.309f4e3ea54d1537.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/7261-8ff69d3b2ee671fd.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7266.084c6bbc70035140.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7271.5c0100e7320aa856.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7429-bf5731358c8f2f68.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7464.01f7a0ae1215fbe7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7479.0fcad5f37eb64f0c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7483.427a2fe2049e388d.js +148 -0
- package/apps/pwa/out/_next/static/chunks/7502-be74718178e13e56.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7530.0889722b19572065.js +24 -0
- package/apps/pwa/out/_next/static/chunks/7645.5b2ee3ad45c55ea3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7788.7d1c79f1a8e18946.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7900.096f455c7c1efc53.js +77 -0
- package/apps/pwa/out/_next/static/chunks/7910-6f139bcafd238b9f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7966.f71c8958d1637548.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5947-135e26537d80a6b9.js → 8062-7cd0bcc7f01455ba.js} +3 -3
- package/apps/pwa/out/_next/static/chunks/8073.f6cf2f2c71aafbd0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8201.190b94088980f430.js +74 -0
- package/apps/pwa/out/_next/static/chunks/8205.282ca4bb62d54a0a.js +62 -0
- package/apps/pwa/out/_next/static/chunks/8313-dfa1021bb58a46d6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/837-81336ebaca8198a8.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8447.7963352ef5f71b76.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8574-868e8129525ef6d9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8588.d1c6a2903727ce87.js +149 -0
- package/apps/pwa/out/_next/static/chunks/8637.90f92d5c8db4732c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{2743.5d3f76948be32b34.js → 868.6e953be05bcf6dca.js} +2 -2
- package/apps/pwa/out/_next/static/chunks/8706-e1fe0309343a2273.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8749-06384cdfc4520add.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5964-7e21164a8f2cf0ce.js → 8861-cc1fa1c7b920fa8e.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/8967-7dfebf710c9dec9d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{5159.115f1c2ca471386c.js → 8986.8e2e4efbfa655c59.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/8997-3c564dbb3b58b055.js +1 -0
- package/apps/pwa/out/_next/static/chunks/923.2034d10ae91e9c20.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9312.bc1b89c5d4368033.js +1 -0
- package/apps/pwa/out/_next/static/chunks/943.39ae5e82f4f1893f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9469.0500480de55fb205.js +32 -0
- package/apps/pwa/out/_next/static/chunks/9770.5f75bc6088b16109.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9810-2543267050e58b82.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9870.8419702475254745.js +8 -0
- package/apps/pwa/out/_next/static/chunks/9941-376d1b74d51b01a4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9958.385434ab04241758.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{b2271e54.c1de3347976e90b0.js → aa57532f.510551854ff239b1.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/_not-found/page-deea1450b17cb8dc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-70985b904f8650ef.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-a2e15e33e56a4353.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-fc72ce2db12d6ca9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-be03e41f9436ebd9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/bots/page-35a35999382da3f2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-3ff5b1e6ca88b848.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/chat/page-a65101300a0ee5c1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/consult/page-3aca5b6d67dba511.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/control/page-45b8ab0a71e61314.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/decisions/page-53046e282d4cda8e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-17809e60e8354c17.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/page-fd2442d347bf5898.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/page-e9d720d6fc082e21.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/field/page-6b8b4267bab0a677.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/healthz/route-deea1450b17cb8dc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/inside/page-8bcf6233ac7c17af.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/page-7cc25591cfc2126f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/layout-053e871f35c9beba.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live/page-eff819f0c2d5e084.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live-run/page-4d7e9d8db5274a87.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/loops/page-2b2d8f5aa5f69ad4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/page-0b8f92c5062e68b1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-1bd9d0fdac2ced3d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/morning/page-9ee28f7df07428ea.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/not-found-44b7a1ff468c6648.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-cbc6523711dc1b65.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-fdad47899c2695be.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/release/{page-40f9e19149024298.js → page-79a8b5fee4c20871.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-03e8ac9606aeaffb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-4cd55c55ec287e2f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/page-db17b4305404161e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-30041d848350fd02.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-c540da022dbf86b0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-9399efc538da057f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/{page-a142dfb0331a05f5.js → page-ca2d09128c585ca4.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-0e2635aecd343038.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-ef7f4399b6b7726e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/layout-deea1450b17cb8dc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/page-caf530535b875468.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/page-eaa20c1543a5fd8e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-c541eb1b75120f61.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-ab5e213eda9479f4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/term/page-0a815f34367b6db6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/today/page-e858ba0ed9393b68.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/page-1638ee9dd6e0582f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/vault/page-4cf5a399109391f2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-b4396321238798ec.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-cb72bfd21006781a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-6135d0242afbc434.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-a1dccf907eddb856.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{53aeb4ee-51c92f8d683f5220.js → c7945435-b44d4dbe90ba0dcb.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{2fdf2931.b431eee4fb468bc3.js → cb0f8df8.09a4a6be97e3fc5f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{c0c1a699.0ba79f97005965d4.js → d96660fb.cbc21a2a88539dbb.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/ea514caa.05a24f78d9dffe5f.js +122 -0
- package/apps/pwa/out/_next/static/chunks/{83184dcd-0ee6247ff41eb3f2.js → fb7d20d5-6892502b6ee39ca6.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/framework-e8a911e19b1be41f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/main-7022f418fabba021.js +1 -0
- package/apps/pwa/out/_next/static/chunks/main-app-e5f15df755756a1e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/pages/_app-4525f91e36940c9b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/pages/_error-140f0e519c085b0f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/webpack-8f22ef63dcb865b1.js +1 -0
- package/apps/pwa/out/_next/static/css/{b9d8151e48998417.css → 62c858ad53854f47.css} +1 -1
- package/apps/pwa/out/_next/static/css/d1f8bb401740a549.css +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +23 -23
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +23 -23
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +23 -23
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +22 -22
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +22 -22
- package/apps/pwa/out/ceo/index.html +1 -1
- package/apps/pwa/out/ceo/index.txt +23 -23
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +22 -22
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +23 -23
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +23 -23
- package/apps/pwa/out/decisions/index.html +1 -1
- package/apps/pwa/out/decisions/index.txt +22 -22
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +23 -23
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +24 -25
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +23 -23
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +23 -23
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +22 -22
- package/apps/pwa/out/inside/index.html +1 -1
- package/apps/pwa/out/inside/index.txt +23 -23
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +23 -23
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +24 -25
- package/apps/pwa/out/live-run/index.html +1 -1
- package/apps/pwa/out/live-run/index.txt +24 -25
- package/apps/pwa/out/loops/index.html +1 -1
- package/apps/pwa/out/loops/index.txt +22 -22
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +22 -22
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +22 -22
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +23 -23
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +23 -23
- package/apps/pwa/out/ops/checklist/index.html +1 -1
- package/apps/pwa/out/ops/checklist/index.txt +22 -22
- package/apps/pwa/out/ops/release/index.html +1 -1
- package/apps/pwa/out/ops/release/index.txt +22 -22
- package/apps/pwa/out/ops/seats/index.html +1 -1
- package/apps/pwa/out/ops/seats/index.txt +22 -22
- package/apps/pwa/out/outputs/index.html +1 -1
- package/apps/pwa/out/outputs/index.txt +22 -22
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +23 -23
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +23 -23
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +22 -22
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +23 -23
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +23 -23
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +23 -23
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +23 -23
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +23 -23
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +22 -22
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +23 -23
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +23 -23
- package/apps/pwa/out/today/index.html +1 -1
- package/apps/pwa/out/today/index.txt +23 -23
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +23 -23
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +23 -23
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +23 -23
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +23 -23
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +23 -23
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +23 -23
- package/catalog/external-commands.yaml +5 -3
- package/catalog/meta/catalogVersion.yaml +2 -1
- package/catalog/signing/catalog-signing-public.pem +3 -0
- package/docs/goal-context/04-mock-scenarios.md +13 -0
- package/graphs/catalog/catalog.yaml +1 -1
- package/graphs/heal/heal-loop.yaml +1 -0
- package/graphs/intake/intake-daily.yaml +16 -0
- package/graphs/intake/news-sources.yaml +1 -0
- package/graphs/intake/recipes.yaml +7 -0
- package/graphs/overlays/examples/research-runtime-empty-terminal.yaml +28 -0
- package/graphs/overlays/stop-heal-ladder.yaml +113 -0
- package/graphs/profiles/local.yaml +5 -0
- package/graphs/profiles/pod.yaml +4 -0
- package/graphs/units/verbs/recipes.yaml +11 -11
- package/graphs/work/research-report.yaml +10 -2
- package/package.json +6 -2
- package/plugins/demo-absorption-briefing/plugin.json +18 -0
- package/plugins/demo-absorption-briefing/skills/demo-absorption-briefing/SKILL.md +8 -0
- package/plugins/demo-browser-hand/plugin.json +13 -0
- package/plugins/demo-browser-hand/skills/demo-browser-hand/SKILL.md +8 -0
- package/plugins/demo-linear-secretary/plugin.json +15 -0
- package/plugins/demo-linear-secretary/skills/demo-linear-secretary/SKILL.md +8 -0
- package/plugins/demo-plugin-wizard/plugin.json +11 -0
- package/plugins/demo-plugin-wizard/skills/demo-plugin-wizard/SKILL.md +8 -0
- package/plugins/demo-research/plugin.json +16 -0
- package/plugins/demo-research/skills/demo-research/SKILL.md +8 -0
- package/plugins/demo-video-briefing/plugin.json +15 -0
- package/plugins/demo-video-briefing/skills/demo-video-briefing/SKILL.md +8 -0
- package/scripts/build-signed-catalog.ts +48 -0
- package/scripts/ci-typecheck-main-delta.sh +88 -0
- package/scripts/codex-fallback-live-probe.ts +1 -1
- package/scripts/demo/demo1104-parallel-scenes.ts +301 -0
- package/scripts/demo/demo1104-stage.config.ts +21 -0
- package/scripts/demo/demo1104-stage.ts +316 -0
- package/scripts/goal-method-audit.ts +17 -1
- package/scripts/graph-units/land-enqueue.ts +90 -0
- package/scripts/heal/run-role.ts +99 -5
- package/scripts/hooks/codex-notify.sh +32 -0
- package/scripts/install.sh +10 -38
- package/scripts/land-global-checks.ts +6 -1
- package/scripts/landing-heal/land-plan.ts +57 -0
- package/scripts/lib/decompose-ab.ts +1 -0
- package/scripts/lib/fixtures/tui-regress/help-insufficient-commands.txt +15 -0
- package/scripts/lib/fixtures/tui-regress/help-live.txt +42 -0
- package/scripts/lib/fixtures/tui-regress/help-missing-keys.txt +21 -0
- package/scripts/lib/fixtures/tui-regress/help-original.txt +51 -0
- package/scripts/lib/fixtures/tui-regress/help-shifted-input.txt +26 -0
- package/scripts/lib/tui-regress-checks.ts +33 -13
- package/scripts/release-loop/auto-approve-node.ts +1 -1
- package/scripts/release-loop/gate-autoheal-sim-evidence.ts +60 -0
- package/scripts/release-loop/gate-baseline-receipt.ts +47 -9
- package/scripts/release-loop/gate-image-pin.ts +81 -0
- package/scripts/release-loop/gate-method.ts +139 -0
- package/scripts/release-loop/gate-node-sim.ts +207 -0
- package/scripts/release-loop/gate-node.ts +463 -64
- package/scripts/release-loop/gate-pod-image-sticky-plan.ts +99 -0
- package/scripts/release-loop/gate-radius-live.ts +97 -13
- package/scripts/release-loop/gate-shard-dispatch.ts +43 -0
- package/scripts/release-loop/gate-traffic-mode.ts +151 -3
- package/scripts/release-loop/gate-train-receipts.ts +122 -0
- package/scripts/release-loop/node-verdict.ts +38 -25
- package/scripts/release-loop/preflight.ts +362 -8
- package/scripts/release-loop/resume-release.ts +83 -8
- package/scripts/release-loop/unattended-release.ts +20 -9
- package/scripts/rhythm/daily.ts +36 -4
- package/scripts/rhythm/linear-progress-sync.ts +298 -0
- package/scripts/ux-sim.ts +18 -1
- package/scripts/video-pipeline.ts +9 -1
- package/scripts/warm-pool-provider-config.ts +286 -0
- package/skills/omni-crawl/SKILL.md +5 -2
- package/skills/omni-crawl/scripts/main.ts +84 -23
- package/src/acp/agent-manager.ts +1 -0
- package/src/acp/codex-app-server-agent.ts +33 -0
- package/src/acp/codex-app-server-client.ts +153 -16
- package/src/acp/core-turn-bridge.ts +27 -9
- package/src/acp/event-router.ts +20 -1
- package/src/acp/server.ts +6 -0
- package/src/agent/registry.ts +2 -0
- package/src/agent/task-notification.ts +25 -5
- package/src/agent/types.ts +6 -0
- package/src/agent-mission/browser-roundtrip-coordinator.ts +85 -0
- package/src/agent-mission/claude-headless.ts +4 -1
- package/src/agent-mission/codex-exec.ts +105 -0
- package/src/agent-mission/driver.ts +192 -11
- package/src/agent-mission/grok-auth-status.ts +47 -0
- package/src/agent-mission/hand-hooks.ts +101 -0
- package/src/agent-mission/mission-cli.ts +63 -4
- package/src/agent-mission/mission-hand-reply.ts +118 -0
- package/src/agent-mission/mission-line.ts +180 -0
- package/src/agent-mission/mission-out.ts +833 -0
- package/src/agent-mission/tool-install.ts +200 -3
- package/src/agent-substrate/context-strategy.ts +4 -4
- package/src/agent-substrate/self-review-cli.ts +178 -13
- package/src/agents/general-purpose.md +1 -1
- package/src/auto-research/research-turn.ts +211 -53
- package/src/autopilot/pr-manager.ts +69 -10
- package/src/autopilot/pty-control-loop.ts +2 -0
- package/src/boot/daemon-tools/self-implement.ts +3 -1
- package/src/boot/daemon-tools/web-search.ts +1 -2
- package/src/briefing/brief-items.ts +55 -11
- package/src/capture/tui-self-report.ts +22 -6
- package/src/chat/index.ts +1 -1
- package/src/cli/agent-cli.ts +2 -1
- package/src/cli/catalog-cli.ts +31 -0
- package/src/cli/connector-cli.ts +16 -0
- package/src/cli/doctor-fix.ts +2 -2
- package/src/cli/fixtures/review-loop-breaker/opwaiver-32646-1694ccc7a170.json +1 -0
- package/src/cli/fixtures/review-loop-breaker/opwaiver-32853-bd8f73595c83.json +1 -0
- package/src/cli/fixtures/review-loop-breaker/opwaiver-33097-1cc85900413c.json +1 -0
- package/src/cli/fixtures/review-loop-breaker/opwaiver-33106-972f31e4a3ca.json +1 -0
- package/src/cli/fixtures/review-loop-breaker/opwaiver-33113-3ab51f05968f.json +1 -0
- package/src/cli/fixtures/review-loop-breaker/pr-33097-1cc85900413c.json +1 -0
- package/src/cli/intake-source-cli.ts +44 -8
- package/src/cli/msg-cli.ts +32 -3
- package/src/cli/pr-cli.ts +21 -1
- package/src/cli/pr-land-heavy-remote.ts +75 -5
- package/src/cli/pr-land-overlap-evidence.ts +113 -2
- package/src/cli/pr-land-pod-shadow-job.ts +202 -4
- package/src/cli/pr-land-pod-shadow.ts +9 -2
- package/src/cli/release-checklist-read-cli.ts +57 -19
- package/src/cli/release-cli.ts +23 -3
- package/src/cli/research-cli.ts +13 -5
- package/src/cli/setup-cli.ts +166 -6
- package/src/cli/setup-keys.ts +187 -0
- package/src/cli/task-plugin-wizard-host.ts +114 -0
- package/src/cli/tasks-cli.ts +61 -9
- package/src/cli/tui-test-cli.ts +186 -0
- package/src/compact/auto.ts +8 -1
- package/src/config.ts +4 -2
- package/src/connectors/linear-daily-progress.ts +228 -0
- package/src/connectors/linear-projector.ts +34 -12
- package/src/connectors/linear.ts +151 -7
- package/src/control-plane/ledger.ts +52 -2
- package/src/control-plane/server.ts +16 -2
- package/src/core-turn/deep-turn-bloom.ts +67 -0
- package/src/core-turn/research-policy.ts +37 -0
- package/src/core-turn/run-core-turn.ts +606 -95
- package/src/core-turn/run-goal-loop.ts +18 -0
- package/src/core-turn/types.ts +4 -0
- package/src/dashboard/chat/acp-chat.ts +10 -0
- package/src/dashboard/classic-sidetab-mission-job.ts +161 -0
- package/src/dashboard/classic-sidetab-mission-pair.ts +81 -0
- package/src/dashboard/classic-sidetab-mission-trio.ts +219 -0
- package/src/dashboard/classic-sidetab-mission.ts +347 -0
- package/src/dashboard/index.ts +517 -18
- package/src/dashboard/input/agent-wake.ts +23 -1
- package/src/dashboard/input/chat-main-acp-dispatch.ts +23 -0
- package/src/dashboard/input/chat-main-plain-turn-runtime.ts +17 -0
- package/src/dashboard/mission-cli-consumer.ts +165 -0
- package/src/dashboard/plugin-wizard-runtime.ts +50 -0
- package/src/dashboard/plugin-wizard-tool.ts +55 -0
- package/src/dashboard/seat-boot-preamble.ts +171 -1
- package/src/dashboard/side-basic-runtime.ts +54 -1
- package/src/dashboard/sidetab-runtime.ts +90 -1
- package/src/dashboard/skill-catalog-preamble.ts +101 -0
- package/src/dashboard/skill-detection-runtime.ts +55 -15
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +15 -0
- package/src/dashboard/terminal-popup-runtime.ts +6 -3
- package/src/dashboard/turn-preamble.ts +53 -15
- package/src/dashboard/turn-prompt-runtime.ts +4 -2
- package/src/decisions/linear-progress-summary.ts +78 -0
- package/src/decisions/linear-progress-sync.ts +152 -0
- package/src/domains/outbound-alert.ts +49 -11
- package/src/domains/telegram-kind-route.ts +16 -9
- package/src/graph-runner/arg-allowance.ts +13 -0
- package/src/graph-runner/graph-cli.ts +23 -7
- package/src/graph-runner/graph-run-api.ts +3 -1
- package/src/graph-runner/graph-tick.ts +10 -2
- package/src/graph-runner/runner.ts +86 -18
- package/src/graph-wizard/mission-compose.ts +407 -12
- package/src/grok/agent-search.ts +14 -4
- package/src/grok/credential.ts +28 -11
- package/src/harness/dispatch-backpressure.ts +54 -1
- package/src/harness/dispatch-shadow-compare.ts +74 -0
- package/src/harness/harness-cli-command.ts +11 -1
- package/src/harness/harness-pod-dispatch.ts +81 -15
- package/src/harness/harness-stop.ts +155 -11
- package/src/harness/skill-exec.ts +21 -9
- package/src/harness/skill-select.ts +1 -1
- package/src/hooks/error-report-cloud.ts +101 -0
- package/src/hooks/receiver.ts +29 -2
- package/src/index.ts +159 -13
- package/src/instance/spawn-elanous.ts +6 -4
- package/src/intake-plane/actions.ts +354 -0
- package/src/intake-plane/adapters/telegram-ambient.ts +34 -18
- package/src/intake-plane/intake-sources.ts +78 -8
- package/src/intake-plane/items.ts +14 -4
- package/src/intake-plane/linear-mission-sync.ts +80 -0
- package/src/intake-plane/linear-secretary-runtime.ts +178 -0
- package/src/intake-plane/linear-wish.ts +227 -1
- package/src/life/life-cli.ts +168 -0
- package/src/life/life-kinds.ts +160 -0
- package/src/live-supply/budget-consumer.ts +78 -0
- package/src/live-supply/read.ts +3 -0
- package/src/live-supply/snapshot.ts +45 -0
- package/src/llm/provider-credentials.ts +8 -2
- package/src/llm.ts +168 -9
- package/src/loops/orchestrator/coordinator-shadow.ts +226 -0
- package/src/loops/orchestrator/tick.ts +13 -0
- package/src/maturity/feature-maturity.ts +4 -4
- package/src/msg/msg-sse-server.ts +3 -3
- package/src/msg/msg-store.ts +177 -19
- package/src/native-tool-catalog.ts +38 -4
- package/src/nexus/api/harness-traversal.ts +11 -0
- package/src/nexus/api/http-server.ts +37 -1
- package/src/nexus/api/mcp-public-allowlist.ts +2 -0
- package/src/nexus/index.ts +7 -2
- package/src/nexus/outbound/format.ts +9 -0
- package/src/nexus/outbound/router.ts +98 -13
- package/src/nexus/setup-status.ts +9 -0
- package/src/nexus/state/state.ts +3 -0
- package/src/oauth/codex-account-store.ts +20 -7
- package/src/oauth/codex-owner-mirror.ts +44 -0
- package/src/oauth/codex.ts +17 -2
- package/src/oauth/fallback-chain.ts +47 -17
- package/src/onboarding/first-run-doctor.ts +8 -1
- package/src/onboarding/first-run.ts +85 -26
- package/src/onboarding/key-setup.ts +103 -0
- package/src/onboarding/menu-answer.ts +13 -0
- package/src/onboarding/secret-prompt.ts +37 -0
- package/src/plugins/install/plugin-install.ts +59 -0
- package/src/pr-tool/census.ts +133 -2
- package/src/pty-shell/pty-control-ipc.ts +4 -1
- package/src/pty-shell/tui-run-state.ts +188 -2
- package/src/registry/catalog-server.ts +232 -0
- package/src/registry/loader.ts +45 -1
- package/src/registry/types.ts +1 -2
- package/src/release-loop/checklist-target-path-hint.ts +13 -0
- package/src/release-loop/checklist.ts +9 -1
- package/src/repl/index.ts +43 -2
- package/src/research/axis-fanout.ts +136 -16
- package/src/research/bloom-exemplars.ts +3 -1
- package/src/research/gap-followup.ts +13 -1
- package/src/research/plugin-discovery.ts +36 -14
- package/src/research-bridge/invoke.ts +22 -5
- package/src/research-bridge/types.ts +2 -0
- package/src/self-dev/ask-launch-flow.ts +72 -1
- package/src/self-dev/decompose.ts +119 -5
- package/src/self-dev/dev-cli.ts +4 -1
- package/src/self-dev/dev-pipeline.ts +5 -0
- package/src/self-dev/draft-residue.ts +64 -5
- package/src/self-dev/graph-front-nodes.ts +2 -1
- package/src/self-dev/graph-journey-route.ts +76 -21
- package/src/self-dev/launch-preflight-text.ts +5 -6
- package/src/self-dev/launch-preflight.ts +58 -0
- package/src/self-dev/orchestrate.ts +13 -3
- package/src/self-dev/review-provider-fallback.ts +9 -2
- package/src/self-dev/run-supervisor.ts +42 -4
- package/src/self-dev/run-types.ts +4 -0
- package/src/self-dev/shard-aggregate.ts +4 -0
- package/src/self-dev/shard-run.ts +36 -15
- package/src/self-implement/abandoned-classification.ts +12 -3
- package/src/self-implement/budget-gate.ts +7 -0
- package/src/self-implement/child-llm-preference.ts +10 -1
- package/src/self-implement/doctor-visit.ts +118 -8
- package/src/self-implement/elanous-tui-spawn.ts +3 -0
- package/src/self-implement/fixtures/tdd-green-missing-passing-child-transcript.txt +2 -0
- package/src/self-implement/gate-artifacts.ts +2 -1
- package/src/self-implement/goal-author-cli.ts +4 -2
- package/src/self-implement/goal-author.ts +684 -7
- package/src/self-implement/graph-overlay-yaml.ts +37 -4
- package/src/self-implement/graph-overlay.ts +3 -1
- package/src/self-implement/graph-profile-yaml.ts +107 -0
- package/src/self-implement/graph-yaml.ts +26 -3
- package/src/self-implement/headless-elanous-driver.ts +31 -2
- package/src/self-implement/heal-intake.ts +112 -4
- package/src/self-implement/heal-triage.ts +20 -0
- package/src/self-implement/host-regate.ts +27 -4
- package/src/self-implement/merge-train.ts +5 -0
- package/src/self-implement/off-diff-evidence.ts +249 -5
- package/src/self-implement/orchestrator.ts +365 -25
- package/src/self-implement/regate-detail.ts +38 -1
- package/src/self-implement/rework-child-provider.ts +25 -0
- package/src/self-implement/run-chart.ts +122 -0
- package/src/self-implement/run-ledger.ts +162 -11
- package/src/self-implement/run-stop.ts +188 -4
- package/src/self-implement/runtime-overlay-run-steps.ts +95 -0
- package/src/self-implement/stop-autoheal.ts +13 -0
- package/src/self-implement/tdd-evidence-tags.ts +9 -0
- package/src/self-implement/train-gate-receipt.ts +166 -0
- package/src/self-implement/train-gate-remote.ts +62 -18
- package/src/session/chat.ts +40 -4
- package/src/session/session-fanout.ts +2 -0
- package/src/session/streaming/acp-stream-sink.ts +2 -1
- package/src/session/streaming/chunk-producer.ts +6 -0
- package/src/session/streaming/stream-compositor.ts +3 -2
- package/src/session-runtime/index.ts +135 -5
- package/src/session-runtime/retry-policy.ts +1 -1
- package/src/session-runtime/tier-flip.ts +3 -3
- package/src/setup/llm-env-detect.ts +3 -0
- package/src/setup/service-key-catalog.ts +46 -0
- package/src/setup/service-keys.ts +241 -0
- package/src/sidetab-core/model.ts +19 -5
- package/src/sidetab-core/visible-agent-mission.ts +262 -0
- package/src/skills/name-match.ts +20 -0
- package/src/skills/tools/agent.ts +53 -6
- package/src/skills/tools/omni-search.ts +173 -13
- package/src/task-agent/parent-host.ts +10 -0
- package/src/task-agent/pod-distributor-entry.ts +3 -0
- package/src/task-agent/repair-outcomes.ts +65 -0
- package/src/task-agent/task-hand.ts +47 -7
- package/src/task-orchestrator/dispatcher.ts +14 -1
- package/src/task-orchestrator/linear-capture-events.ts +55 -0
- package/src/task-orchestrator/store.ts +16 -5
- package/src/task-orchestrator/surfaces/pod-artifact-return.ts +4 -0
- package/src/task-orchestrator/surfaces/pod-distributor.ts +48 -0
- package/src/task-orchestrator/surfaces/pod-failure-reason.ts +92 -1
- package/src/task-orchestrator/surfaces/pod-ledger-collect.ts +38 -1
- package/src/task-orchestrator/surfaces/pod-ledger-events.ts +113 -14
- package/src/task-orchestrator/surfaces/pod-si-warm-entry.ts +33 -6
- package/src/task-orchestrator/surfaces/pod-source-bundle.ts +45 -9
- package/src/task-orchestrator/surfaces/pod-source-receive.ts +178 -16
- package/src/task-orchestrator/surfaces/pod-source-spec.ts +3 -3
- package/src/task-orchestrator/surfaces/pod-warm-switch.ts +2 -0
- package/src/task-orchestrator/surfaces/pod-warm-worker-provider.ts +237 -41
- package/src/task-orchestrator/surfaces/pod-warm-worker-runtime.ts +80 -3
- package/src/task-orchestrator/surfaces/self-implement-pod.ts +337 -51
- package/src/task-orchestrator/surfaces/self-implement.ts +27 -3
- package/src/task-orchestrator/surfaces/warm-reuse-evidence.ts +169 -0
- package/src/task-orchestrator/types.ts +14 -0
- package/src/telegram.ts +14 -16
- package/src/terminal/coding-agent.ts +14 -5
- package/src/terminal/session-registry.ts +1 -1
- package/src/tokens.ts +35 -2
- package/src/tool-hints/gate.ts +1 -0
- package/src/tool-runtime/agent-runtime.ts +2 -0
- package/src/tool-runtime/browser-hand-runtime.ts +381 -0
- package/src/tool-runtime/browser-runtime.ts +2 -1
- package/src/tool-runtime/elanous-linear-issue-runtime.ts +76 -0
- package/src/tool-runtime/elanous-linear-secretary-runtime.ts +57 -0
- package/src/tool-runtime/elanous-skills-list-runtime.ts +5 -1
- package/src/tool-runtime/graph-mcp-runtimes.ts +240 -0
- package/src/tool-runtime/index.ts +6 -0
- package/src/tool-runtime/skill-exec-runtime.ts +33 -13
- package/src/tool-runtime/types.ts +4 -0
- package/src/tui/entry.ts +38 -5
- package/src/tui/sidetab/attach.ts +177 -1
- package/src/tui/sidetab/herdr-portal.ts +225 -0
- package/src/tui-client/local-chat-turn.ts +26 -13
- package/src/tui.ts +22 -0
- package/src/user-config.ts +34 -9
- package/src/user-intent/types.ts +4 -3
- package/src/ux-sim/browser-hand.ts +165 -0
- package/src/ux-sim/draft-inventory-builder.ts +198 -0
- package/src/ux-sim/fake-browser-page.ts +81 -0
- package/src/ux-sim/fake-kubectl.ts +37 -3
- package/src/ux-sim/fake-linear-device.ts +31 -0
- package/src/ux-sim/fault-pool-cap.ts +11 -6
- package/src/ux-sim/graph-engine-sim.ts +47 -0
- package/src/ux-sim/linear-secretary.ts +216 -0
- package/src/ux-sim/mock-scenario-catalog.json +93 -0
- package/src/ux-sim/mock-scenario-catalog.ts +274 -0
- package/src/ux-sim/onboarding-first-run-device.ts +31 -21
- package/src/ux-sim/scenario.ts +185 -48
- package/src/ux-sim/service-key-setup.ts +50 -0
- package/src/ux-sim/term-slash-device.ts +74 -0
- package/src/ux-sim/turn-throw-sim.ts +31 -0
- package/src/version/packed-revision.json +1 -1
- package/src/voice/voice-tts-singleton.ts +18 -3
- package/src/web-search/exa.ts +77 -0
- package/src/web-search/grok.ts +5 -9
- package/src/web-search/index.ts +30 -9
- package/src/web-search/provider.ts +4 -1
- package/src/web-search/x-intent.ts +5 -0
- package/apps/pwa/out/_next/static/chunks/1115.434ae2ecb0ad986d.js +0 -149
- package/apps/pwa/out/_next/static/chunks/1121.667cec0bcdbb3fdb.js +0 -36
- package/apps/pwa/out/_next/static/chunks/1197-54da59d250a6e476.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1245.1cfd13b26dbd71d6.js +0 -287
- package/apps/pwa/out/_next/static/chunks/1494-f93046ff5c5a124d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1609.2b312797599b8e45.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1661.0dd330f3d89f73f3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/167-0c121e4b47e0f9da.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1700.cdc2bf8cc685e221.js +0 -90
- package/apps/pwa/out/_next/static/chunks/1703-78e46acad29f3cfc.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1765.679b29625c8e88d4.js +0 -77
- package/apps/pwa/out/_next/static/chunks/1971-7efb628c471dc5a0.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1999-8de7b7bb36801913.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2073.689dcb2680113d76.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2198-557d49184104d165.js +0 -1
- package/apps/pwa/out/_next/static/chunks/221-440ce67fa9f5c839.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2427-8ed8e98624cbd664.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2457-725c5827bc003795.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2491-2718b15a5ccb75a5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2527-5c636a43c7cc5dde.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2692-1027cb16fe4ccf49.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2773.0e80b9d325fb5635.js +0 -32
- package/apps/pwa/out/_next/static/chunks/2873-0f3cb56c8e3528ea.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3097.864e92bdaa2f4d15.js +0 -79
- package/apps/pwa/out/_next/static/chunks/3136-d6870ba63300a93e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3173-0289113d434e83b7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/325-dd9208a1a0ab7ce4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3283.528f430dd043fb4e.js +0 -74
- package/apps/pwa/out/_next/static/chunks/3295.cc8cb13b8f0dae1a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3688-86e3b88abf18cb3b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3804-7220467a5473a8df.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3808.3e1e247ce7bdf889.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3927.b5473ad109da44c5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3934-98ea94832e194796.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4156.ba4de4a3664f04b4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4297-239ca82f293faab0.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4320-dcc5a7734126f4c9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4434.94b4c552a2d91e69.js +0 -148
- package/apps/pwa/out/_next/static/chunks/4579.03e4092f73950965.js +0 -226
- package/apps/pwa/out/_next/static/chunks/4667.97e31aa38c95c475.js +0 -309
- package/apps/pwa/out/_next/static/chunks/4702.4a4adc1f16d7c93b.js +0 -64
- package/apps/pwa/out/_next/static/chunks/4815.481501c57b3568d9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/487-d16e698ef14662d9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4888-7a38bf522c9cc6fe.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5034-30e429d6bb086881.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5040-35c494e60dadd97d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/50c6ab1e.81a96e419350909d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5154.4b6a836179356f30.js +0 -94
- package/apps/pwa/out/_next/static/chunks/5228-a8200df486278f2d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5379.97af106d09566f69.js +0 -8
- package/apps/pwa/out/_next/static/chunks/5479-b6372e762719f92f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5534-699c5cbcbc96c5d7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5701.9c4e8f250312eeee.js +0 -24
- package/apps/pwa/out/_next/static/chunks/5892.2526d962339662d8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5937.c2df9e3447e1f667.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5941.8210cc93c9202c0a.js +0 -286
- package/apps/pwa/out/_next/static/chunks/5975.4004f820ae3cecd5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6142-7ccd48795d7abd55.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6160.bf9177b8c1bfb243.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6398.71ba0690c8027555.js +0 -27
- package/apps/pwa/out/_next/static/chunks/6492.2bd5c10edc1a064e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6552.a3840aa7da35ad68.js +0 -62
- package/apps/pwa/out/_next/static/chunks/6736.1e36d3ac5fa5e41d.js +0 -24
- package/apps/pwa/out/_next/static/chunks/6900.3ccbe069bdd4556a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/71327eb4.add50b365f94bf3a.js +0 -122
- package/apps/pwa/out/_next/static/chunks/7136.deca3e3a2ddaa374.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7139-ee9f8ed2677a40b3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7191.fdc955f7d96064a4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7423-e0aa5d9e2962120e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7453.afc1ea7e05d56a8c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7503-5e6a3d7fe67e4a0c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7761-476fd7bf768abd34.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7975.eafb12097a0a9e62.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8050-9b364bdef8f71927.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8152.64e253c35cccfaae.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8190.620f0231b3924bcb.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8448.45b6b1f1a99eeb35.js +0 -104
- package/apps/pwa/out/_next/static/chunks/8464-e24f10451b658aac.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8477.e4c944bb3aa5d2f3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8710.ca385257d5ca422e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8830.627ccf294ec2465c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8880.64c445592f04acaf.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8981.c706964c8ba27aff.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9053.bd0fffaff8d3f836.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9161-c66e723d7ec9d682.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9185.1ecdf9b65c0bb684.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9356.fccd5f58086b4ff5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9446.dc0406109371d329.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9506.dcf25d467a42627e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9541.eb8e2f8480c7feca.js +0 -93
- package/apps/pwa/out/_next/static/chunks/9577.ed7582186efa5482.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9579.4a8169600fff2058.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9642-ff2e039eb62e3b92.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9659-8f2323348113ad80.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9724.4c5623af2db43153.js +0 -34
- package/apps/pwa/out/_next/static/chunks/9869.81a1e24ca682d5a0.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/_not-found/page-8d9d76ea322d855c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-ed2c4e59f9f1fe21.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-2dc99e03c5d76ca0.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-b5a3a788330e920f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-14949db884bfa672.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-ea76c85b36388a97.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-01716d20af62d325.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-62baf6881a64b1e9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/page-f89ba590c2af8afa.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-22f8b0f78d9637e5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/decisions/page-817f9d7e6820be80.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-ffb9bc0d2650249a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-f6d0e64873c0f629.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/exec/page-8bfa0d4ba23a209d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/field/page-f5060462249e32c7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/healthz/route-8d9d76ea322d855c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-b2049f8b1ef79117.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-1446c5fa93907f11.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-b48a7a07c5204156.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-e974b8c4ca47614c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live-run/page-8a919b869bd28594.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/loops/page-d31b8de6bfcd72ed.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-64765f817909db29.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-d128c8569a36ee9b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/morning/page-b2679d357e9b9270.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-6fabec98a9e7b269.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-048f30149dcf1349.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-9113181d6b5a2725.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-1e7a755a13227611.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-3c8f8b67a203cf07.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/page-18032f5437215062.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-da3b739192fd0ee3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-d332545571bd6fd1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-5237aa5b3f3b8ec5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-d16e56c3989c147e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-6b6593600869e2cd.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/layout-8d9d76ea322d855c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-29e8b8a8396b55cb.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/share/page-b3414d856a1a7e2f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-c3affa52b7ce961b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-f21dddf9f95b6fab.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-f5a30a24745bf088.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-8c8569a09b4d4e34.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-2ce32722c0243483.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/page-4767b0d9c0a98c6c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-116ee1339c387a75.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-35e8c50ca4ef7ffc.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-52e17113356bb891.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-7458ae05ed2ac1a0.js +0 -1
- package/apps/pwa/out/_next/static/chunks/framework-ad6c9dd524ad6ef8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/main-app-2ddd1f2b44d6aa59.js +0 -1
- package/apps/pwa/out/_next/static/chunks/main-e3d82bdc358d20c5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/pages/_app-71d5aa3896e1655f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/pages/_error-03ffc54e00438546.js +0 -1
- package/apps/pwa/out/_next/static/chunks/webpack-56bb89af5a611d0b.js +0 -1
- package/apps/pwa/out/_next/static/css/be9019f696217521.css +0 -1
- package/apps/pwa/out/_next/static/css/d0a48dc099ed86cf.css +0 -1
- /package/apps/pwa/out/_next/static/{GiOLWmt4MqDZePubBjA4Q → Om5xS9jpjSXJCeTNGYEi4}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, utimesSync, writeFileSync, writeSync } from 'node:fs';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
5
|
+
import type { Command } from 'commander';
|
|
6
|
+
import { debug, redactSecretText } from '../debug/log.js';
|
|
7
|
+
import type { AsyncLockHandle } from '../storage/file-lock.js';
|
|
8
|
+
import { stateDirSourceForChild } from '../agent/identity-env.js';
|
|
9
|
+
import { createMissionLineStore, MissionLineHttpError, postMissionLineEvent, type MissionLineType } from './mission-line.js';
|
|
10
|
+
import type { LinearMissionLink } from '../intake-plane/linear-mission-sync.js';
|
|
11
|
+
|
|
12
|
+
const MISSION_CONTEXT_ENV = 'ELANOUS_MISSION_CONTEXT';
|
|
13
|
+
const HAND_CHILD_ENV_KEYS = [
|
|
14
|
+
'ELANOUS_MISSION_ID', 'ELANOUS_ATTEMPT_ID', 'ELANOUS_HAND_TOKEN', 'ELANOUS_HAND_ATTEMPT_ID',
|
|
15
|
+
'ELANOUS_HAND_FINAL_LINE_ID', 'ELANOUS_HAND_AGENT', 'ELANOUS_HAND_RUN_ID', 'ELANOUS_HAND_PTY_ID',
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
interface MissionContext { missionId: string; storeRoot: string }
|
|
19
|
+
|
|
20
|
+
function missionContextForEnv(env: NodeJS.ProcessEnv, missionId: string): MissionContext | undefined {
|
|
21
|
+
const encoded = env[MISSION_CONTEXT_ENV]?.trim();
|
|
22
|
+
if (!encoded) return undefined;
|
|
23
|
+
try {
|
|
24
|
+
const value = JSON.parse(encoded) as Partial<MissionContext>;
|
|
25
|
+
if (value.missionId !== missionId || typeof value.storeRoot !== 'string' || !isAbsolute(value.storeRoot)) return undefined;
|
|
26
|
+
return { missionId, storeRoot: resolve(value.storeRoot) };
|
|
27
|
+
} catch { return undefined; }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function missionChildEnv(root: string, missionId: string, base: NodeJS.ProcessEnv = process.env, line?: { token: string; attemptId: string; finalLineId: string; agent: 'codex' | 'claude'; nexusUrl?: string; runId?: string; ptyId?: string }): NodeJS.ProcessEnv {
|
|
31
|
+
const storeRoot = resolve(root);
|
|
32
|
+
const childBase = { ...base };
|
|
33
|
+
for (const key of HAND_CHILD_ENV_KEYS) delete childBase[key];
|
|
34
|
+
return {
|
|
35
|
+
...childBase,
|
|
36
|
+
ELANOUS_STATE_DIR: storeRoot,
|
|
37
|
+
ELANOUS_STATE_DIR_SOURCE: stateDirSourceForChild(storeRoot, base),
|
|
38
|
+
...(line ? { ELANOUS_MISSION_ID: missionId, ELANOUS_ATTEMPT_ID: line.attemptId,
|
|
39
|
+
ELANOUS_HAND_TOKEN: line.token, ELANOUS_HAND_ATTEMPT_ID: line.attemptId,
|
|
40
|
+
ELANOUS_HAND_FINAL_LINE_ID: line.finalLineId, ELANOUS_HAND_AGENT: line.agent,
|
|
41
|
+
...(line.runId ? { ELANOUS_HAND_RUN_ID: line.runId, ELANOUS_RUN_ID: line.runId } : {}),
|
|
42
|
+
...(line.ptyId ? { ELANOUS_HAND_PTY_ID: line.ptyId } : {}), ...(line.nexusUrl ? { ELANOUS_NEXUS_URL: line.nexusUrl } : {}) } : {}),
|
|
43
|
+
[MISSION_CONTEXT_ENV]: JSON.stringify({ missionId, storeRoot }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type MissionOutStatus = 'running' | 'completed' | 'cancelled' | 'failed' | 'timeout';
|
|
48
|
+
export class MissionReplyStateError extends Error {
|
|
49
|
+
constructor(readonly status: 404 | 409, message: string) { super(message); this.name = 'MissionReplyStateError'; }
|
|
50
|
+
}
|
|
51
|
+
export interface MissionReplyEvent {
|
|
52
|
+
type: 'mission.reply';
|
|
53
|
+
missionId: string;
|
|
54
|
+
sequence: number;
|
|
55
|
+
text: string;
|
|
56
|
+
done: boolean;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
kind?: string;
|
|
59
|
+
defaults?: string;
|
|
60
|
+
deadline?: string;
|
|
61
|
+
scope?: string;
|
|
62
|
+
stop?: boolean;
|
|
63
|
+
priority?: string;
|
|
64
|
+
lineId?: string;
|
|
65
|
+
attemptId?: string;
|
|
66
|
+
runId?: string;
|
|
67
|
+
ptyId?: string;
|
|
68
|
+
replyTo?: number;
|
|
69
|
+
agent?: 'codex' | 'claude';
|
|
70
|
+
lineType?: 'progress' | 'final' | 'ask' | 'answer' | 'correct';
|
|
71
|
+
source?: string;
|
|
72
|
+
state?: string;
|
|
73
|
+
who?: string;
|
|
74
|
+
what?: string;
|
|
75
|
+
graphEvents?: Array<{ seq: number; ts: string; type: 'node-added'; node: string; kind: 'hand'; decider: 'mission-line'; reason: string; who: string; what: string; missionId: string }>;
|
|
76
|
+
}
|
|
77
|
+
export interface MissionReplyMessageFields {
|
|
78
|
+
kind?: string;
|
|
79
|
+
defaults?: string;
|
|
80
|
+
deadline?: string;
|
|
81
|
+
scope?: string;
|
|
82
|
+
stop?: boolean;
|
|
83
|
+
priority?: string;
|
|
84
|
+
lineId?: string;
|
|
85
|
+
attemptId?: string;
|
|
86
|
+
runId?: string;
|
|
87
|
+
ptyId?: string;
|
|
88
|
+
replyTo?: number;
|
|
89
|
+
agent?: 'codex' | 'claude';
|
|
90
|
+
lineType?: 'progress' | 'final' | 'ask' | 'answer' | 'correct';
|
|
91
|
+
source?: string;
|
|
92
|
+
state?: string;
|
|
93
|
+
who?: string;
|
|
94
|
+
what?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface MissionOutRecord {
|
|
97
|
+
missionId: string;
|
|
98
|
+
agent: 'codex' | 'claude';
|
|
99
|
+
prompt: string;
|
|
100
|
+
cwd: string;
|
|
101
|
+
outputPath: string;
|
|
102
|
+
targetOutputPath: string;
|
|
103
|
+
status: MissionOutStatus;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
error?: string;
|
|
107
|
+
result?: string;
|
|
108
|
+
doneReceived?: boolean;
|
|
109
|
+
pendingFinalReply?: string;
|
|
110
|
+
workerPid?: number;
|
|
111
|
+
agentPid?: number;
|
|
112
|
+
/** Server-validated DEMO child issue; never populated from a reply payload. */
|
|
113
|
+
linearLink?: LinearMissionLink;
|
|
114
|
+
}
|
|
115
|
+
export interface MissionOutStoreDeps {
|
|
116
|
+
now?: () => Date;
|
|
117
|
+
id?: () => string;
|
|
118
|
+
emit?: (event: MissionReplyEvent) => void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface MissionCancelResult { record: MissionOutRecord; transitioned: boolean }
|
|
122
|
+
|
|
123
|
+
const MISSION_LOCK_STALE_MS = 30_000;
|
|
124
|
+
const MISSION_LOCK_RETRY_MS = 25;
|
|
125
|
+
const MISSION_LOCK_MAX_TRIES = 240;
|
|
126
|
+
|
|
127
|
+
class MissionLockStaleError extends Error {
|
|
128
|
+
constructor(readonly missionId: string, readonly ageMs: number) {
|
|
129
|
+
super(`미션 잠금이 낡았습니다(${Math.round(ageMs)}ms). 자동 회수하지 않았습니다; 잠금이 풀린 뒤 재시도하거나 담당자 판단이 필요합니다`);
|
|
130
|
+
this.name = 'MissionLockStaleError';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function acquireMissionLock(lockPath: string, missionId: string, onStale: (ageMs: number) => void): Promise<AsyncLockHandle> {
|
|
135
|
+
for (let attempt = 0; attempt < MISSION_LOCK_MAX_TRIES; attempt += 1) {
|
|
136
|
+
const token = `${process.pid}:${randomUUID()}`;
|
|
137
|
+
try {
|
|
138
|
+
const fd = openSync(lockPath, 'wx', 0o600);
|
|
139
|
+
try { writeSync(fd, `${token}\n`); }
|
|
140
|
+
catch (error) { try { unlinkSync(lockPath); } catch { /* best effort for the file we just created */ } throw error; }
|
|
141
|
+
finally { closeSync(fd); }
|
|
142
|
+
|
|
143
|
+
let lost = false;
|
|
144
|
+
const ownsFile = (): boolean => {
|
|
145
|
+
try { return readFileSync(lockPath, 'utf8').trim() === token; }
|
|
146
|
+
catch { return false; }
|
|
147
|
+
};
|
|
148
|
+
const heartbeat = setInterval(() => {
|
|
149
|
+
if (lost) return;
|
|
150
|
+
if (!ownsFile()) { lost = true; clearInterval(heartbeat); return; }
|
|
151
|
+
try { const now = new Date(); utimesSync(lockPath, now, now); }
|
|
152
|
+
catch { lost = true; clearInterval(heartbeat); }
|
|
153
|
+
}, Math.floor(MISSION_LOCK_STALE_MS / 3));
|
|
154
|
+
(heartbeat as unknown as { unref?: () => void }).unref?.();
|
|
155
|
+
return {
|
|
156
|
+
stillHeld: () => !lost && ownsFile(),
|
|
157
|
+
release: () => {
|
|
158
|
+
clearInterval(heartbeat);
|
|
159
|
+
if (ownsFile()) { try { unlinkSync(lockPath); } catch { /* owner has already gone */ } }
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
} catch (error) {
|
|
163
|
+
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error;
|
|
164
|
+
let ageMs: number;
|
|
165
|
+
try {
|
|
166
|
+
const first = statSync(lockPath);
|
|
167
|
+
ageMs = Date.now() - first.mtimeMs;
|
|
168
|
+
const token = readFileSync(lockPath, 'utf8').trim();
|
|
169
|
+
const current = statSync(lockPath);
|
|
170
|
+
if (first.ino !== current.ino || token !== readFileSync(lockPath, 'utf8').trim()) continue;
|
|
171
|
+
ageMs = Date.now() - current.mtimeMs;
|
|
172
|
+
} catch { continue; }
|
|
173
|
+
if (ageMs > MISSION_LOCK_STALE_MS) {
|
|
174
|
+
onStale(ageMs);
|
|
175
|
+
throw new MissionLockStaleError(missionId, ageMs);
|
|
176
|
+
}
|
|
177
|
+
await new Promise((resolveDelay) => setTimeout(resolveDelay, MISSION_LOCK_RETRY_MS));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
throw new Error(`mission lock timed out at ${lockPath}`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const validId = (id: string): boolean => /^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(id);
|
|
184
|
+
const safeRecordPath = (root: string, id: string): string => {
|
|
185
|
+
if (!validId(id)) throw new Error('missionId 형식이 올바르지 않습니다');
|
|
186
|
+
return join(root, 'agent-missions', `${id}.json`);
|
|
187
|
+
};
|
|
188
|
+
const replyPath = (root: string, id: string): string => safeRecordPath(root, id).replace(/\.json$/, '.replies.jsonl');
|
|
189
|
+
|
|
190
|
+
function validateReplyMessageFields(fields: MissionReplyMessageFields): MissionReplyMessageFields {
|
|
191
|
+
for (const key of ['kind', 'defaults', 'deadline', 'scope', 'priority'] as const) {
|
|
192
|
+
const value = fields[key];
|
|
193
|
+
if (value !== undefined && (typeof value !== 'string' || !value.trim())) throw new Error(`reply ${key} 는 비어 있지 않은 문자열이어야 합니다`);
|
|
194
|
+
}
|
|
195
|
+
for (const key of ['attemptId', 'runId', 'ptyId', 'source', 'state', 'who', 'what', 'lineId'] as const) {
|
|
196
|
+
const value = fields[key];
|
|
197
|
+
if (value !== undefined && (typeof value !== 'string' || !value.trim())) throw new Error(`reply ${key} 는 비어 있지 않은 문자열이어야 합니다`);
|
|
198
|
+
}
|
|
199
|
+
if (fields.replyTo !== undefined && (!Number.isInteger(fields.replyTo) || fields.replyTo < 1)) throw new Error('reply replyTo 는 양의 정수여야 합니다');
|
|
200
|
+
if (fields.lineId !== undefined && !/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(fields.lineId)) {
|
|
201
|
+
throw new Error('reply lineId 는 UUID 형식이어야 합니다');
|
|
202
|
+
}
|
|
203
|
+
if (fields.agent !== undefined && fields.agent !== 'codex' && fields.agent !== 'claude') throw new Error('reply agent 값이 올바르지 않습니다');
|
|
204
|
+
if (fields.lineType !== undefined && !['progress', 'final', 'ask', 'answer', 'correct'].includes(fields.lineType)) throw new Error('reply lineType 값이 올바르지 않습니다');
|
|
205
|
+
if (fields.stop !== undefined && typeof fields.stop !== 'boolean') throw new Error('reply stop 은 boolean 이어야 합니다');
|
|
206
|
+
if (fields.kind === 'correct' && (!fields.scope || fields.stop === undefined || !fields.priority)) {
|
|
207
|
+
throw new Error('reply kind=correct 에는 scope, stop, priority 가 필요합니다');
|
|
208
|
+
}
|
|
209
|
+
// ask / answer / correct are reserved names. Unknown names remain accepted
|
|
210
|
+
// as extension kinds.
|
|
211
|
+
return fields;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function atomicJson(path: string, value: unknown): void {
|
|
215
|
+
const temp = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
216
|
+
writeFileSync(temp, `${JSON.stringify(value)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
217
|
+
renameSync(temp, path);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export async function waitForMissionAnswer(store: ReturnType<typeof createMissionOutStore>, missionId: string, ask: Pick<MissionReplyEvent, 'sequence' | 'deadline'>, defaults: string, deps: { now?: () => number; sleep?: (ms: number) => Promise<void> } = {}): Promise<{ text: string; usedDefault: boolean }> {
|
|
221
|
+
const now = deps.now ?? Date.now;
|
|
222
|
+
const sleep = deps.sleep ?? ((ms: number) => new Promise<void>((resolveDelay) => setTimeout(resolveDelay, ms)));
|
|
223
|
+
const parsedDeadline = ask.deadline ? Date.parse(ask.deadline) : Number.NaN;
|
|
224
|
+
const deadline = Number.isFinite(parsedDeadline) ? parsedDeadline : now() + 2 * 60_000;
|
|
225
|
+
while (now() < deadline) {
|
|
226
|
+
const answer = store.replies(missionId).find((event) => event.kind === 'answer' && event.replyTo === ask.sequence);
|
|
227
|
+
if (answer) return { text: answer.text, usedDefault: false };
|
|
228
|
+
await sleep(Math.min(250, Math.max(1, deadline - now())));
|
|
229
|
+
}
|
|
230
|
+
return { text: defaults, usedDefault: true };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function createMissionOutStore(root: string, deps: MissionOutStoreDeps = {}) {
|
|
234
|
+
const now = deps.now ?? (() => new Date());
|
|
235
|
+
const withLock = async <T>(missionId: string, action: (lock: AsyncLockHandle) => T): Promise<T> => {
|
|
236
|
+
const lockPath = `${replyPath(root, missionId)}.lock`;
|
|
237
|
+
mkdirSync(dirname(lockPath), { recursive: true, mode: 0o700 });
|
|
238
|
+
const lock = await acquireMissionLock(lockPath, missionId, (lockAgeMs) => {
|
|
239
|
+
debug.log('agent-mission', 'lock-stale', { missionId, lockAgeMs, recovery: 'manual-or-retry' });
|
|
240
|
+
});
|
|
241
|
+
try { return action(lock); }
|
|
242
|
+
finally { lock.release(); }
|
|
243
|
+
};
|
|
244
|
+
const read = (missionId: string): MissionOutRecord | null => {
|
|
245
|
+
try {
|
|
246
|
+
const value: unknown = JSON.parse(readFileSync(safeRecordPath(root, missionId), 'utf8'));
|
|
247
|
+
if (!value || typeof value !== 'object' || (value as MissionOutRecord).missionId !== missionId) return null;
|
|
248
|
+
return value as MissionOutRecord;
|
|
249
|
+
} catch { return null; }
|
|
250
|
+
};
|
|
251
|
+
const replies = (missionId: string): MissionReplyEvent[] => {
|
|
252
|
+
try {
|
|
253
|
+
return readFileSync(replyPath(root, missionId), 'utf8').split('\n').filter(Boolean).flatMap((line) => {
|
|
254
|
+
try {
|
|
255
|
+
const event: unknown = JSON.parse(line);
|
|
256
|
+
return event && typeof event === 'object' && (event as MissionReplyEvent).type === 'mission.reply'
|
|
257
|
+
&& (event as MissionReplyEvent).missionId === missionId ? [event as MissionReplyEvent] : [];
|
|
258
|
+
} catch { return []; }
|
|
259
|
+
});
|
|
260
|
+
} catch { return []; }
|
|
261
|
+
};
|
|
262
|
+
return {
|
|
263
|
+
create(input: { missionId?: string; agent: 'codex' | 'claude'; prompt: string; cwd: string; outputPath: string; targetOutputPath: string; linearLink?: LinearMissionLink }): MissionOutRecord {
|
|
264
|
+
const dir = join(root, 'agent-missions');
|
|
265
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
266
|
+
const createdAt = now().toISOString();
|
|
267
|
+
const record: MissionOutRecord = {
|
|
268
|
+
missionId: input.missionId ?? (deps.id ?? randomUUID)(), ...input, status: 'running', createdAt, updatedAt: createdAt,
|
|
269
|
+
};
|
|
270
|
+
const path = safeRecordPath(root, record.missionId);
|
|
271
|
+
if (existsSync(path)) throw new Error('missionId 충돌');
|
|
272
|
+
atomicJson(path, record);
|
|
273
|
+
return record;
|
|
274
|
+
},
|
|
275
|
+
read,
|
|
276
|
+
replies,
|
|
277
|
+
lockStale(missionId: string): boolean {
|
|
278
|
+
try { return Date.now() - statSync(`${replyPath(root, missionId)}.lock`).mtimeMs > MISSION_LOCK_STALE_MS; }
|
|
279
|
+
catch { return false; }
|
|
280
|
+
},
|
|
281
|
+
async reply(missionId: string, text: string, done = false, fields: MissionReplyMessageFields = {}): Promise<MissionReplyEvent> {
|
|
282
|
+
if (!text.trim()) throw new Error('reply 본문이 비었습니다');
|
|
283
|
+
const messageFields = validateReplyMessageFields(fields);
|
|
284
|
+
return withLock(missionId, (lock) => {
|
|
285
|
+
const priorLine = messageFields.lineId
|
|
286
|
+
? replies(missionId).find((event) => event.lineId === messageFields.lineId)
|
|
287
|
+
: undefined;
|
|
288
|
+
if (priorLine) return priorLine;
|
|
289
|
+
const current = read(missionId);
|
|
290
|
+
if (!current) throw new MissionReplyStateError(404, `미션을 찾을 수 없습니다: ${missionId}`);
|
|
291
|
+
if (current.status !== 'running') throw new MissionReplyStateError(409, `미션이 실행 중이 아닙니다: ${current.status}`);
|
|
292
|
+
if (current.doneReceived || replies(missionId).some((event) => event.done)) throw new MissionReplyStateError(409, '최종 답변이 이미 제출됐습니다');
|
|
293
|
+
if (messageFields.kind === 'ask' && replies(missionId).filter((event) => event.kind === 'ask').length >= 3) {
|
|
294
|
+
throw new MissionReplyStateError(409, '미션당 ask 는 최대 3회입니다; 남은 정보로 진행하거나 다시 작성하세요');
|
|
295
|
+
}
|
|
296
|
+
const askDeadline = messageFields.kind === 'ask'
|
|
297
|
+
? (messageFields.deadline ?? new Date(now().getTime() + 2 * 60_000).toISOString())
|
|
298
|
+
: undefined;
|
|
299
|
+
const event: MissionReplyEvent = {
|
|
300
|
+
type: 'mission.reply', missionId, sequence: replies(missionId).length + 1,
|
|
301
|
+
text, done, createdAt: now().toISOString(), ...messageFields,
|
|
302
|
+
...(askDeadline ? { deadline: askDeadline } : {}),
|
|
303
|
+
...(replies(missionId).length === 0 && messageFields.who && messageFields.what ? {
|
|
304
|
+
graphEvents: [{ seq: 1, ts: now().toISOString(), type: 'node-added', node: `hand-${missionId}`, kind: 'hand', decider: 'mission-line', reason: 'hand mission line opened', who: messageFields.who, what: messageFields.what, missionId }],
|
|
305
|
+
} : {}),
|
|
306
|
+
};
|
|
307
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 reply 기록을 중단했습니다');
|
|
308
|
+
appendFileSync(replyPath(root, missionId), `${JSON.stringify(event)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
309
|
+
if (!done) {
|
|
310
|
+
try { deps.emit?.(event); } catch { /* observation failure cannot lose a persisted reply */ }
|
|
311
|
+
}
|
|
312
|
+
if (done) {
|
|
313
|
+
current.doneReceived = true;
|
|
314
|
+
// The agent's claimed final answer is not public until the worker
|
|
315
|
+
// exits successfully and validates the required output file.
|
|
316
|
+
current.pendingFinalReply = text;
|
|
317
|
+
current.updatedAt = event.createdAt;
|
|
318
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 reply 상태 저장을 중단했습니다');
|
|
319
|
+
atomicJson(safeRecordPath(root, missionId), current);
|
|
320
|
+
}
|
|
321
|
+
return event;
|
|
322
|
+
});
|
|
323
|
+
},
|
|
324
|
+
complete(missionId: string): Promise<MissionOutRecord> {
|
|
325
|
+
return withLock(missionId, (lock) => {
|
|
326
|
+
const record = read(missionId);
|
|
327
|
+
if (!record) throw new Error(`미션을 찾을 수 없습니다: ${missionId}`);
|
|
328
|
+
if (record.status !== 'running') return record;
|
|
329
|
+
if (!existsSync(record.outputPath) || statSync(record.outputPath).size === 0) throw new Error('결과 파일이 없어 미션을 실패 처리했습니다');
|
|
330
|
+
const finalText = record.pendingFinalReply ?? readFileSync(record.outputPath, 'utf8');
|
|
331
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 결과 공개를 중단했습니다');
|
|
332
|
+
renameSync(record.outputPath, record.targetOutputPath);
|
|
333
|
+
if (!lock.stillHeld()) {
|
|
334
|
+
try { renameSync(record.targetOutputPath, record.outputPath); } catch { /* keep the failed transition fail-closed */ }
|
|
335
|
+
throw new Error('미션 상태 잠금을 잃어 완료 기록을 중단했습니다');
|
|
336
|
+
}
|
|
337
|
+
record.status = 'completed';
|
|
338
|
+
record.updatedAt = now().toISOString();
|
|
339
|
+
record.result = finalText;
|
|
340
|
+
record.doneReceived = true;
|
|
341
|
+
delete record.pendingFinalReply;
|
|
342
|
+
atomicJson(safeRecordPath(root, missionId), record);
|
|
343
|
+
const finalEvent = replies(missionId).find((event) => event.done);
|
|
344
|
+
if (finalEvent) {
|
|
345
|
+
try { deps.emit?.(finalEvent); } catch { /* persisted final reply remains authoritative */ }
|
|
346
|
+
}
|
|
347
|
+
return read(missionId)!;
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
finish(missionId: string, outcome: { status: 'cancelled' | 'failed' | 'timeout'; error?: string }): Promise<MissionOutRecord> {
|
|
351
|
+
return withLock(missionId, (lock) => {
|
|
352
|
+
const record = read(missionId);
|
|
353
|
+
if (!record) throw new Error(`미션을 찾을 수 없습니다: ${missionId}`);
|
|
354
|
+
if (record.status === 'running') {
|
|
355
|
+
record.status = outcome.status;
|
|
356
|
+
record.updatedAt = now().toISOString();
|
|
357
|
+
delete record.result;
|
|
358
|
+
delete record.doneReceived;
|
|
359
|
+
delete record.pendingFinalReply;
|
|
360
|
+
if (outcome.error !== undefined) record.error = outcome.error;
|
|
361
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 terminal 상태 저장을 중단했습니다');
|
|
362
|
+
atomicJson(safeRecordPath(root, missionId), record);
|
|
363
|
+
}
|
|
364
|
+
return read(missionId)!;
|
|
365
|
+
});
|
|
366
|
+
},
|
|
367
|
+
setPids(missionId: string, pids: { workerPid?: number; agentPid?: number }): Promise<MissionOutRecord> {
|
|
368
|
+
return withLock(missionId, (lock) => {
|
|
369
|
+
const record = read(missionId);
|
|
370
|
+
if (!record) throw new Error(`미션을 찾을 수 없습니다: ${missionId}`);
|
|
371
|
+
if (record.status === 'running') {
|
|
372
|
+
Object.assign(record, pids, { updatedAt: now().toISOString() });
|
|
373
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 PID 저장을 중단했습니다');
|
|
374
|
+
atomicJson(safeRecordPath(root, missionId), record);
|
|
375
|
+
}
|
|
376
|
+
return read(missionId)!;
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
cancel(missionId: string): Promise<MissionCancelResult> {
|
|
380
|
+
return withLock(missionId, (lock) => {
|
|
381
|
+
const record = read(missionId);
|
|
382
|
+
if (!record) throw new Error(`미션을 찾을 수 없습니다: ${missionId}`);
|
|
383
|
+
const transitioned = record.status === 'running';
|
|
384
|
+
if (transitioned) {
|
|
385
|
+
record.status = 'cancelled';
|
|
386
|
+
record.updatedAt = now().toISOString();
|
|
387
|
+
delete record.pendingFinalReply;
|
|
388
|
+
delete record.doneReceived;
|
|
389
|
+
delete record.result;
|
|
390
|
+
if (!lock.stillHeld()) throw new Error('미션 상태 잠금을 잃어 취소를 저장하지 않았습니다');
|
|
391
|
+
atomicJson(safeRecordPath(root, missionId), record);
|
|
392
|
+
}
|
|
393
|
+
return { record: read(missionId)!, transitioned };
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export type MissionAgentRunner = (record: MissionOutRecord, prompt: string) => Promise<{ code: number | null; stderr?: string }>;
|
|
400
|
+
|
|
401
|
+
async function createObservedMissionOutStore(root: string) {
|
|
402
|
+
const { registerStandaloneLogSink } = await import('../domains/standalone-log-sink.js');
|
|
403
|
+
await registerStandaloneLogSink('agent-mission');
|
|
404
|
+
return createMissionOutStore(root, { emit: (event) => debug.log('agent-mission', 'reply', event) });
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export async function runMissionOutWorker(root: string, missionId: string, runAgent?: MissionAgentRunner): Promise<void> {
|
|
408
|
+
const store = await createObservedMissionOutStore(root);
|
|
409
|
+
const record = store.read(missionId);
|
|
410
|
+
if (!record || record.status !== 'running') return;
|
|
411
|
+
try {
|
|
412
|
+
await store.setPids(missionId, { workerPid: process.pid });
|
|
413
|
+
if (store.read(missionId)?.status !== 'running') return;
|
|
414
|
+
const prompt = `${record.prompt}${renderMissionAgentInstructions(missionId, root)}\n\nWrite the final answer to the requested output file: ${record.outputPath}`;
|
|
415
|
+
const result = await (runAgent ?? createProcessAgentRunner(root))(record, prompt);
|
|
416
|
+
if (result.code !== 0) throw new Error(`agent exited with code ${String(result.code)}${result.stderr?.trim() ? `: ${result.stderr.trim()}` : ''}`);
|
|
417
|
+
if (!existsSync(record.outputPath) || statSync(record.outputPath).size === 0) throw new Error('결과 파일이 없어 미션을 실패 처리했습니다');
|
|
418
|
+
const latest = store.read(missionId);
|
|
419
|
+
if (!latest || latest.status !== 'running') return;
|
|
420
|
+
if (!latest.doneReceived) {
|
|
421
|
+
const finalText = readFileSync(record.outputPath, 'utf8');
|
|
422
|
+
const lineToken = process.env.ELANOUS_HAND_TOKEN?.trim();
|
|
423
|
+
const lineAttemptId = process.env.ELANOUS_HAND_ATTEMPT_ID?.trim();
|
|
424
|
+
const lineId = process.env.ELANOUS_HAND_FINAL_LINE_ID?.trim() || randomUUID();
|
|
425
|
+
const persistedFinal = lineAttemptId
|
|
426
|
+
? store.replies(missionId).find((event) => event.done && event.attemptId === lineAttemptId)
|
|
427
|
+
: undefined;
|
|
428
|
+
if (persistedFinal) {
|
|
429
|
+
// NEXUS may have durably appended the final row but lost its HTTP
|
|
430
|
+
// response. Reuse that row; never append a second terminal event.
|
|
431
|
+
} else if (lineToken && lineAttemptId) {
|
|
432
|
+
try {
|
|
433
|
+
await postMissionLineEvent({ lineId, missionId, attemptId: lineAttemptId, agent: record.agent, type: 'final', source: 'mission-worker', text: finalText, state: 'completed' });
|
|
434
|
+
} catch (error) {
|
|
435
|
+
if (error instanceof MissionLineHttpError && error.status < 500) throw error;
|
|
436
|
+
// The local mission ledger is the durability boundary. NEXUS is an
|
|
437
|
+
// observation/transport edge; an unavailable daemon must not turn a
|
|
438
|
+
// valid output file into a lost final reply.
|
|
439
|
+
debug.log('agent-mission', 'line-ingress-fallback', { missionId, error: redactSecretText(String(error)) });
|
|
440
|
+
const racedFinal = store.replies(missionId).find((event) => event.lineId === lineId);
|
|
441
|
+
if (!racedFinal) await store.reply(missionId, finalText, true, {
|
|
442
|
+
lineId, attemptId: lineAttemptId, agent: record.agent, lineType: 'final', source: 'mission-worker', state: 'completed',
|
|
443
|
+
...(store.replies(missionId).length === 0 ? { who: record.agent === 'claude' ? 'Claude' : 'Codex', what: record.prompt.replace(/\s+/g, ' ').trim().slice(0, 180) || 'hand mission' } : {}),
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
} else await store.reply(missionId, finalText, true);
|
|
447
|
+
}
|
|
448
|
+
await store.complete(missionId);
|
|
449
|
+
} catch (e) {
|
|
450
|
+
const latest = store.read(missionId);
|
|
451
|
+
if (latest?.status === 'running') {
|
|
452
|
+
try {
|
|
453
|
+
await store.finish(missionId, {
|
|
454
|
+
status: 'failed',
|
|
455
|
+
error: redactSecretText(String(e)).replace(record.outputPath, '[internal output]').replace(record.targetOutputPath, '[output]'),
|
|
456
|
+
});
|
|
457
|
+
} catch (stateError) {
|
|
458
|
+
debug.log('agent-mission', 'terminal-write-failed', { missionId, error: redactSecretText(String(stateError)) }, { level: 'error' });
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
} finally {
|
|
462
|
+
// The attempt credential belongs to this worker job, including failure and
|
|
463
|
+
// cancellation paths. Revocation is idempotent when a final line already
|
|
464
|
+
// closed the token at the NEXUS ingress.
|
|
465
|
+
createMissionLineStore(root).revoke(missionId);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export function createProcessAgentRunner(root: string, spawnProcess: typeof spawn = spawn): MissionAgentRunner {
|
|
470
|
+
return async (record, prompt) => {
|
|
471
|
+
const backend = record.agent === 'codex'
|
|
472
|
+
? { command: 'codex', args: ['exec', '--approve-for-me', '--output-last-message', record.outputPath, '-'], scrub: ['OPENAI_API_KEY'] }
|
|
473
|
+
: { command: 'claude', args: ['-p', '--output-format', 'stream-json', '--verbose', '--dangerously-skip-permissions'], scrub: ['ANTHROPIC_API_KEY', 'ANTHROPIC_AUTH_TOKEN', 'CLAUDE_CODE_OAUTH_TOKEN', 'CLAUDE_CODE_USE_BEDROCK', 'CLAUDE_CODE_USE_VERTEX', 'CLAUDE_CODE_USE_FOUNDRY'] };
|
|
474
|
+
const env = missionChildEnv(root, record.missionId);
|
|
475
|
+
for (const key of backend.scrub) delete env[key];
|
|
476
|
+
const child = spawnProcess(backend.command, backend.args, { cwd: record.cwd, env, stdio: ['pipe', 'ignore', 'pipe'] });
|
|
477
|
+
let stderrTail = '';
|
|
478
|
+
let spawnFailure: Error | undefined;
|
|
479
|
+
child.stderr.setEncoding('utf8');
|
|
480
|
+
child.stderr.on('data', (chunk: string) => { stderrTail = `${stderrTail}${chunk}`.slice(-4000); });
|
|
481
|
+
const processOutcome = new Promise<{ code?: number | null; error?: Error }>((resolveExit) => {
|
|
482
|
+
child.once('error', (error: Error) => { spawnFailure = error; resolveExit({ error }); });
|
|
483
|
+
child.once('close', (code) => resolveExit({ code }));
|
|
484
|
+
});
|
|
485
|
+
if (child.pid) await createMissionOutStore(root).setPids(record.missionId, { agentPid: child.pid });
|
|
486
|
+
if (spawnFailure) throw spawnFailure;
|
|
487
|
+
child.stdin.end(prompt);
|
|
488
|
+
const outcome = await processOutcome;
|
|
489
|
+
if (outcome.error) throw outcome.error;
|
|
490
|
+
return { code: outcome.code ?? null, stderr: redactSecretText(stderrTail) };
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function shellQuote(value: string): string {
|
|
495
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export function renderMissionAgentInstructions(missionId: string, storeRoot: string): string {
|
|
499
|
+
const rootArg = `--config-dir ${shellQuote(resolve(storeRoot))}`;
|
|
500
|
+
const missionArg = `--mission ${missionId}`;
|
|
501
|
+
return [
|
|
502
|
+
'',
|
|
503
|
+
'Elanous mission reply contract:',
|
|
504
|
+
`- Send progress or a question with: eln ${rootArg} mission reply ${missionArg} "<message>"`,
|
|
505
|
+
`- When the task is complete, send the final answer with: eln ${rootArg} mission reply ${missionArg} --done "<final answer>"`,
|
|
506
|
+
`- Inspect this mission with: eln ${rootArg} mission status ${missionId} --json`,
|
|
507
|
+
'- Keep the reply concise. Do not report a filesystem path as the result.',
|
|
508
|
+
].join('\n');
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
const missionUsage = {
|
|
512
|
+
command: 'eln mission',
|
|
513
|
+
commands: {
|
|
514
|
+
run: {
|
|
515
|
+
args: [], flags: ['--agent codex|claude', '--prompt <text>|--prompt-file <path>', '--out <path>', '--linear-issue-id <id>', '--dry-run', '--output-format json'],
|
|
516
|
+
responseSchema: { type: 'object', required: ['id', 'missionId', 'status'], properties: { id: { type: 'string', format: 'uuid' }, missionId: { type: 'string', format: 'uuid' }, status: { const: 'running' }, artifacts: { type: 'array', items: { type: 'string' } } } },
|
|
517
|
+
},
|
|
518
|
+
status: {
|
|
519
|
+
args: ['<id>'],
|
|
520
|
+
responseSchema: { type: 'object', required: ['id', 'missionId', 'status', 'artifacts', 'replies'], properties: { id: { type: 'string', format: 'uuid' }, missionId: { type: 'string', format: 'uuid' }, status: { enum: ['running', 'done', 'cancelled', 'failed', 'timeout'] }, body: { type: 'string' }, artifacts: { type: 'array', items: { type: 'string' } }, replies: { type: 'array', items: { $ref: '#/events/mission.reply' } }, result: { type: 'string' }, lockStale: { type: 'boolean' }, error: { type: 'string' } } },
|
|
521
|
+
},
|
|
522
|
+
reply: {
|
|
523
|
+
args: ['[missionId]', '[text|stdin]'], flags: ['--mission <missionId>', '--done', '--kind <kind>', '--defaults <text>', '--deadline <value>', '--reply-to <sequence>', '--scope <text>', '--[no-]stop', '--priority <value>'],
|
|
524
|
+
responseSchema: { type: 'object', required: ['missionId', 'accepted', 'sequence', 'done'], properties: { missionId: { type: 'string', format: 'uuid' }, accepted: { const: true }, sequence: { type: 'integer', minimum: 1 }, done: { type: 'boolean' } } },
|
|
525
|
+
},
|
|
526
|
+
cancel: {
|
|
527
|
+
args: ['<missionId>'],
|
|
528
|
+
responseSchema: { type: 'object', required: ['missionId', 'status', 'cancelled'], properties: { missionId: { type: 'string', format: 'uuid' }, status: { enum: ['running', 'completed', 'cancelled', 'failed'] }, cancelled: { type: 'boolean' } } },
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
events: { 'mission.reply': { type: 'object', required: ['type', 'missionId', 'sequence', 'text', 'done', 'createdAt'], properties: { type: { const: 'mission.reply' }, missionId: { type: 'string', format: 'uuid' }, sequence: { type: 'integer' }, replyTo: { type: 'integer', minimum: 1 }, runId: { type: 'string' }, ptyId: { type: 'string' }, text: { type: 'string' }, done: { type: 'boolean' }, createdAt: { type: 'string', format: 'date-time' }, kind: { type: 'string', description: 'Reserved kinds: ask, answer, correct.' }, defaults: { type: 'string' }, deadline: { type: 'string' }, scope: { type: 'string' }, stop: { type: 'boolean' }, priority: { type: 'string' } } } },
|
|
532
|
+
replyContract: 'Use `eln --config-dir <storeRoot> mission reply --mission <missionId> <text> [--kind ask|answer|correct]` for replies and `eln --config-dir <storeRoot> mission reply --mission <missionId> --done <text>` for the final answer.',
|
|
533
|
+
agentInstructionBlock: [
|
|
534
|
+
'You can send durable progress and final answers to Elanous with `eln mission reply`.',
|
|
535
|
+
'Use `eln --config-dir <storeRoot> mission reply --mission <missionId> "<message>"` for progress/questions.',
|
|
536
|
+
'Ask for a decision with `--kind ask --defaults <fallback>`; include question and options in the text. An unanswered ask defaults after two minutes. Ask at most three times, then continue with available information or rewrite the task.',
|
|
537
|
+
'Example: `eln --config-dir <storeRoot> mission reply --mission <missionId> --kind ask --defaults main "Which base should I use? Options: main or release/2.4."` blocks until HandReply or the deadline.',
|
|
538
|
+
'For a correction, include --scope, --stop, and --priority; corrections require a bound child run and PTY.',
|
|
539
|
+
'Finish with `eln --config-dir <storeRoot> mission reply --mission <missionId> --done "<final answer>"`.',
|
|
540
|
+
'Use `eln --config-dir <storeRoot> mission status <missionId>` to inspect the interaction; do not return output file paths.',
|
|
541
|
+
].join('\n'),
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
export function registerMissionOutCommand(program: Command, deps: {
|
|
545
|
+
stateRoot?: () => string;
|
|
546
|
+
emit?: (event: MissionReplyEvent) => void;
|
|
547
|
+
readStdin?: () => Promise<string>;
|
|
548
|
+
write?: (text: string) => void;
|
|
549
|
+
error?: (text: string) => void;
|
|
550
|
+
startWorker?: (root: string, missionId: string) => number;
|
|
551
|
+
/** Test seam; production resolves the registered current NEXUS endpoint. */
|
|
552
|
+
resolveNexusUrl?: () => string | null;
|
|
553
|
+
} = {}): Command {
|
|
554
|
+
const write = deps.write ?? ((text) => process.stdout.write(text));
|
|
555
|
+
const error = deps.error ?? ((text) => process.stderr.write(text));
|
|
556
|
+
const root = async (): Promise<string> => deps.stateRoot ? deps.stateRoot() : (await import('../instance/resolve.js')).effectiveInstanceRoot();
|
|
557
|
+
const storeAt = async (observeReplies = false) => {
|
|
558
|
+
const stateRoot = await root();
|
|
559
|
+
if (deps.emit) return createMissionOutStore(stateRoot, { emit: deps.emit });
|
|
560
|
+
return observeReplies ? createObservedMissionOutStore(stateRoot) : createMissionOutStore(stateRoot);
|
|
561
|
+
};
|
|
562
|
+
const observingStoreAt = async (stateRoot: string) => deps.emit
|
|
563
|
+
? createMissionOutStore(stateRoot, { emit: deps.emit })
|
|
564
|
+
: createObservedMissionOutStore(stateRoot);
|
|
565
|
+
const replyStoreAt = async (missionId: string) => {
|
|
566
|
+
const missionContext = missionContextForEnv(process.env, missionId);
|
|
567
|
+
return missionContext ? observingStoreAt(missionContext.storeRoot) : storeAt(true);
|
|
568
|
+
};
|
|
569
|
+
const syncAcceptedLinearReply = async (store: ReturnType<typeof createMissionOutStore>, missionId: string, event: MissionReplyEvent): Promise<void> => {
|
|
570
|
+
try {
|
|
571
|
+
const linkedMission = store.read(missionId);
|
|
572
|
+
if (!linkedMission?.linearLink) return;
|
|
573
|
+
const latestLine = (): { lineType: string; sequence: number } | undefined => store.replies(missionId)
|
|
574
|
+
.filter(reply => reply.lineType === 'progress' || reply.lineType === 'final')
|
|
575
|
+
.sort((a, b) => b.sequence - a.sequence)
|
|
576
|
+
.map(reply => ({ lineType: reply.lineType!, sequence: reply.sequence }))[0];
|
|
577
|
+
const missionContext = missionContextForEnv(process.env, missionId);
|
|
578
|
+
const lockRoot = missionContext?.storeRoot ?? await root();
|
|
579
|
+
const { syncLinearMissionProgress } = await import('../intake-plane/linear-mission-sync.js');
|
|
580
|
+
await syncLinearMissionProgress({
|
|
581
|
+
link: linkedMission.linearLink, lineType: event.lineType, sequence: event.sequence, latestLine: latestLine(),
|
|
582
|
+
}, { lockRoot, getLatestLine: async () => latestLine() });
|
|
583
|
+
} catch (error) {
|
|
584
|
+
debug.log('agent-mission', 'linear-progress-sync-setup-failed', {
|
|
585
|
+
missionId, error: redactSecretText(String(error)),
|
|
586
|
+
}, { level: 'warn' });
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
const out = (opts: { json?: boolean; outputFormat?: string }, value: unknown): void => {
|
|
590
|
+
write(opts.json || opts.outputFormat === 'json' ? `${JSON.stringify(value)}\n` : `${JSON.stringify(value, null, 2)}\n`);
|
|
591
|
+
};
|
|
592
|
+
const cmd = program.command('mission').description('Run a stateless Codex/Claude mission and exchange replies by missionId');
|
|
593
|
+
cmd.option('--usage', 'Print machine-readable mission command tree').action((opts: { usage?: boolean }) => {
|
|
594
|
+
if (opts.usage) out({ json: true }, missionUsage);
|
|
595
|
+
else error('사용법: eln mission --usage | run | status | reply | cancel');
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
cmd.command('run')
|
|
599
|
+
.option('--agent <name>', 'codex or claude')
|
|
600
|
+
.option('--prompt <text>', 'Mission prompt')
|
|
601
|
+
.option('--prompt-file <path>', 'Read the prompt from a UTF-8 file')
|
|
602
|
+
.option('--out <path>', 'Internal result file required for fail-closed completion')
|
|
603
|
+
.option('--linear-issue-id <id>', 'Bind this mission to a verified DEMO subtask')
|
|
604
|
+
.option('--dry-run', 'Resolve and print request without creating a job')
|
|
605
|
+
.option('--json', 'Emit JSON')
|
|
606
|
+
.option('--output-format <format>', 'text or json', 'text')
|
|
607
|
+
.action(async (opts: { agent?: string; prompt?: string; promptFile?: string; out?: string; linearIssueId?: string; dryRun?: boolean; json?: boolean; outputFormat?: string; usage?: boolean }, command: Command) => {
|
|
608
|
+
if (opts.usage || command.optsWithGlobals().usage) { out({ json: true }, missionUsage.commands.run); return; }
|
|
609
|
+
if (!opts.agent) { error('--agent 는 필수입니다\n'); process.exitCode = 2; return; }
|
|
610
|
+
if (!opts.out) { error('--out 은 필수입니다\n'); process.exitCode = 2; return; }
|
|
611
|
+
if (!['codex', 'claude'].includes(opts.agent)) { error('--agent 는 codex 또는 claude 여야 합니다\n'); process.exitCode = 2; return; }
|
|
612
|
+
if ((opts.prompt === undefined) === (opts.promptFile === undefined)) { error('--prompt 와 --prompt-file 중 하나만 지정하세요\n'); process.exitCode = 2; return; }
|
|
613
|
+
let prompt = opts.prompt ?? '';
|
|
614
|
+
try { if (opts.promptFile) prompt = readFileSync(resolve(opts.promptFile), 'utf8'); }
|
|
615
|
+
catch (e) { error(`프롬프트 파일 읽기 실패: ${String(e)}\n`); process.exitCode = 1; return; }
|
|
616
|
+
if (!prompt.trim()) { error('프롬프트가 비었습니다\n'); process.exitCode = 2; return; }
|
|
617
|
+
const targetOutputPath = resolve(opts.out);
|
|
618
|
+
if (opts.outputFormat && !['text', 'json'].includes(opts.outputFormat)) { error('--output-format 은 text 또는 json 이어야 합니다\n'); process.exitCode = 2; return; }
|
|
619
|
+
if (opts.dryRun) { out(opts, { agent: opts.agent, promptChars: prompt.length, outputConfigured: true, cwd: process.cwd(), resolved: true }); return; }
|
|
620
|
+
const store = await storeAt();
|
|
621
|
+
let record: MissionOutRecord | undefined;
|
|
622
|
+
try {
|
|
623
|
+
const linearLink = opts.linearIssueId
|
|
624
|
+
? await (await import('../intake-plane/linear-mission-sync.js')).resolveDemoLinearMissionLink(opts.linearIssueId)
|
|
625
|
+
: undefined;
|
|
626
|
+
const missionId = randomUUID();
|
|
627
|
+
const outputPath = `${targetOutputPath}.eln-mission-${missionId}.tmp`;
|
|
628
|
+
record = store.create({ missionId, agent: opts.agent as 'codex' | 'claude', prompt, cwd: process.cwd(), outputPath, targetOutputPath, ...(linearLink ? { linearLink } : {}) });
|
|
629
|
+
// Injected state roots are test fixtures: avoid discovering a global
|
|
630
|
+
// daemon whose state belongs to another instance. Production callers
|
|
631
|
+
// use effectiveInstanceRoot and resolve their registered NEXUS here.
|
|
632
|
+
const candidateNexusUrl = process.env.ELANOUS_NEXUS_URL?.trim() || deps.resolveNexusUrl?.()
|
|
633
|
+
|| (deps.stateRoot ? null : (await import('../nexus/daemon-endpoint.js')).resolveDaemonEndpoint()?.baseUrl);
|
|
634
|
+
let nexusUrl: string | null = null;
|
|
635
|
+
if (candidateNexusUrl) {
|
|
636
|
+
try {
|
|
637
|
+
const parsed = new URL(candidateNexusUrl);
|
|
638
|
+
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') nexusUrl = parsed.origin;
|
|
639
|
+
} catch { /* invalid NEXUS configuration cannot receive a mission token */ }
|
|
640
|
+
}
|
|
641
|
+
const handLine = nexusUrl ? createMissionLineStore(await root()).issue({
|
|
642
|
+
missionId, attemptId: randomUUID(), agent: record.agent,
|
|
643
|
+
who: record.agent === 'claude' ? 'Claude' : 'Codex',
|
|
644
|
+
what: prompt.replace(/\s+/g, ' ').trim().slice(0, 180) || 'hand mission',
|
|
645
|
+
}) : undefined;
|
|
646
|
+
const { mkdirSync } = await import('node:fs');
|
|
647
|
+
mkdirSync(dirname(targetOutputPath), { recursive: true });
|
|
648
|
+
let workerPid: number;
|
|
649
|
+
if (deps.startWorker) workerPid = deps.startWorker(await root(), record.missionId);
|
|
650
|
+
else {
|
|
651
|
+
const { spawn } = await import('node:child_process');
|
|
652
|
+
const entry = process.argv[1];
|
|
653
|
+
if (!entry) throw new Error('CLI 엔트리 경로를 확인할 수 없습니다');
|
|
654
|
+
const stateRoot = await root();
|
|
655
|
+
const child = spawn(process.execPath, [entry, 'mission', '__worker', record.missionId], {
|
|
656
|
+
cwd: record.cwd, detached: true, stdio: 'ignore', env: missionChildEnv(stateRoot, record.missionId, process.env, handLine && nexusUrl ? { ...handLine, agent: record.agent, nexusUrl } : undefined),
|
|
657
|
+
});
|
|
658
|
+
if (!child.pid) throw new Error('미션 워커 PID 생성 실패');
|
|
659
|
+
child.unref();
|
|
660
|
+
workerPid = child.pid;
|
|
661
|
+
}
|
|
662
|
+
await store.setPids(record.missionId, { workerPid });
|
|
663
|
+
out(opts, { id: record.missionId, missionId: record.missionId, status: 'running', artifacts: [] });
|
|
664
|
+
} catch (e) {
|
|
665
|
+
if (record) {
|
|
666
|
+
try { await store.finish(record.missionId, { status: 'failed', error: redactSecretText(String(e)) }); }
|
|
667
|
+
catch (stateError) { debug.log('agent-mission', 'terminal-write-failed', { missionId: record.missionId, error: redactSecretText(String(stateError)) }, { level: 'error' }); }
|
|
668
|
+
}
|
|
669
|
+
error(`미션 시작 실패: ${String(e)}\n`); process.exitCode = 1;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
cmd.command('status <missionId>').alias('get')
|
|
674
|
+
.option('--json', 'Emit JSON').option('--output-format <format>', 'text or json', 'text')
|
|
675
|
+
.action(async (missionId: string, opts: { json?: boolean; outputFormat?: string; usage?: boolean }, command: Command) => {
|
|
676
|
+
if (opts.usage || command.optsWithGlobals().usage) { out({ json: true }, missionUsage.commands.status); return; }
|
|
677
|
+
const store = await storeAt();
|
|
678
|
+
const record = store.read(missionId);
|
|
679
|
+
if (!record) { error(`미션을 찾을 수 없습니다: ${missionId}\n`); process.exitCode = 1; return; }
|
|
680
|
+
const lockStale = store.lockStale(missionId);
|
|
681
|
+
if (lockStale && !deps.emit) {
|
|
682
|
+
const { registerStandaloneLogSink } = await import('../domains/standalone-log-sink.js');
|
|
683
|
+
await registerStandaloneLogSink('agent-mission');
|
|
684
|
+
debug.log('agent-mission', 'lock-stale', { missionId, recovery: 'manual-or-retry', observedBy: 'status' });
|
|
685
|
+
}
|
|
686
|
+
const publicRecord = {
|
|
687
|
+
id: record.missionId, missionId: record.missionId, agent: record.agent,
|
|
688
|
+
status: record.status === 'completed' ? 'done' : record.status,
|
|
689
|
+
lockStale,
|
|
690
|
+
...(record.result !== undefined ? { body: record.result, artifacts: [record.targetOutputPath] }
|
|
691
|
+
: record.error !== undefined ? { body: record.error, artifacts: [] as string[] }
|
|
692
|
+
: { artifacts: [] as string[] }),
|
|
693
|
+
createdAt: record.createdAt, updatedAt: record.updatedAt,
|
|
694
|
+
...(record.doneReceived ? { doneReceived: true } : {}),
|
|
695
|
+
...(record.result !== undefined ? { result: record.result } : {}),
|
|
696
|
+
...(record.error !== undefined ? { error: record.error } : {}),
|
|
697
|
+
};
|
|
698
|
+
const visibleReplies = store.replies(missionId).filter((event) => !event.done || record.status === 'completed');
|
|
699
|
+
out(opts, { ...publicRecord, replies: visibleReplies });
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
cmd.command('reply [args...]')
|
|
703
|
+
.option('--mission <missionId>', 'Explicit mission ID (works with a separately selected --config-dir)')
|
|
704
|
+
.option('--done', 'Mark this as the final reply')
|
|
705
|
+
.option('--kind <kind>', 'Reserved message kind: ask, answer, or correct')
|
|
706
|
+
.option('--defaults <text>', 'Default values attached to an ask')
|
|
707
|
+
.option('--deadline <value>', 'Requested deadline attached to an ask')
|
|
708
|
+
.option('--scope <text>', 'Correction scope')
|
|
709
|
+
.option('--[no-]stop', 'Correction stop request')
|
|
710
|
+
.option('--priority <value>', 'Correction priority')
|
|
711
|
+
.option('--reply-to <sequence>', 'Ask sequence being answered/corrected')
|
|
712
|
+
.option('--json', 'Emit JSON').option('--output-format <format>', 'text or json', 'text')
|
|
713
|
+
.action(async (rawArgs: string[], opts: { mission?: string; done?: boolean; kind?: string; defaults?: string; deadline?: string; scope?: string; stop?: boolean; priority?: string; replyTo?: string; json?: boolean; outputFormat?: string; usage?: boolean }, command: Command) => {
|
|
714
|
+
if (opts.usage || command.optsWithGlobals().usage) { out({ json: true }, missionUsage.commands.reply); return; }
|
|
715
|
+
const args = [...rawArgs];
|
|
716
|
+
const missionId = opts.mission?.trim() || args.shift();
|
|
717
|
+
if (!missionId) { error('--mission <missionId> 또는 positional <missionId> 가 필요합니다\n'); process.exitCode = 2; return; }
|
|
718
|
+
let text = args.join(' ');
|
|
719
|
+
if (!text.trim()) text = await (deps.readStdin ?? (async () => (await import('../cli/piped-stdin.js')).readPipedStdin()))();
|
|
720
|
+
try {
|
|
721
|
+
if (opts.kind === 'ask' && !opts.defaults?.trim()) throw new Error('reply kind=ask 에는 --defaults 가 필요합니다');
|
|
722
|
+
const lineToken = process.env.ELANOUS_HAND_TOKEN?.trim();
|
|
723
|
+
const lineAttemptId = process.env.ELANOUS_HAND_ATTEMPT_ID?.trim();
|
|
724
|
+
const lineAgent = process.env.ELANOUS_HAND_AGENT === 'claude' ? 'claude' : process.env.ELANOUS_HAND_AGENT === 'codex' ? 'codex' : undefined;
|
|
725
|
+
if (lineToken && lineAttemptId && lineAgent) {
|
|
726
|
+
const replyTo = opts.replyTo === undefined ? undefined : Number(opts.replyTo);
|
|
727
|
+
if (opts.replyTo !== undefined && (!Number.isInteger(replyTo) || (replyTo ?? 0) < 1)) throw new Error('--reply-to 는 양의 정수여야 합니다');
|
|
728
|
+
if (opts.kind === 'correct' && (!opts.scope || opts.stop === undefined || !opts.priority)) {
|
|
729
|
+
throw new Error('reply kind=correct 에는 scope, stop, priority 가 필요합니다');
|
|
730
|
+
}
|
|
731
|
+
const lineId = randomUUID();
|
|
732
|
+
const lineType: NonNullable<MissionReplyMessageFields['lineType']> = opts.done
|
|
733
|
+
? 'final'
|
|
734
|
+
: opts.kind === 'ask' || opts.kind === 'answer' || opts.kind === 'correct' ? opts.kind : 'progress';
|
|
735
|
+
const fields: MissionReplyMessageFields & { lineId: string; attemptId: string; agent: 'codex' | 'claude'; lineType: MissionLineType; source: string } = {
|
|
736
|
+
lineId,
|
|
737
|
+
attemptId: lineAttemptId, agent: lineAgent,
|
|
738
|
+
...(process.env.ELANOUS_HAND_RUN_ID ? { runId: process.env.ELANOUS_HAND_RUN_ID } : {}),
|
|
739
|
+
...(process.env.ELANOUS_HAND_PTY_ID ? { ptyId: process.env.ELANOUS_HAND_PTY_ID } : {}),
|
|
740
|
+
...(replyTo ? { replyTo } : {}),
|
|
741
|
+
lineType,
|
|
742
|
+
source: 'mission-reply', ...(opts.done ? { state: 'completed' } : {}),
|
|
743
|
+
...(opts.kind !== undefined ? { kind: opts.kind } : {}),
|
|
744
|
+
...(opts.defaults !== undefined ? { defaults: opts.defaults } : {}),
|
|
745
|
+
...(opts.deadline !== undefined ? { deadline: opts.deadline } : {}),
|
|
746
|
+
...(opts.scope !== undefined ? { scope: opts.scope } : {}),
|
|
747
|
+
...(opts.stop !== undefined ? { stop: opts.stop } : {}),
|
|
748
|
+
...(opts.priority !== undefined ? { priority: opts.priority } : {}),
|
|
749
|
+
};
|
|
750
|
+
let event: MissionReplyEvent;
|
|
751
|
+
try {
|
|
752
|
+
const lineEvent = await postMissionLineEvent({
|
|
753
|
+
lineId, missionId, attemptId: lineAttemptId, agent: lineAgent,
|
|
754
|
+
...(process.env.ELANOUS_HAND_RUN_ID ? { runId: process.env.ELANOUS_HAND_RUN_ID } : {}),
|
|
755
|
+
...(process.env.ELANOUS_HAND_PTY_ID ? { ptyId: process.env.ELANOUS_HAND_PTY_ID } : {}),
|
|
756
|
+
...(replyTo ? { replyTo } : {}),
|
|
757
|
+
type: lineType, source: 'mission-reply', text, ...(opts.done ? { state: 'completed' } : {}),
|
|
758
|
+
...(opts.kind !== undefined ? { kind: opts.kind } : {}),
|
|
759
|
+
...(opts.defaults !== undefined ? { defaults: opts.defaults } : {}),
|
|
760
|
+
...(opts.deadline !== undefined ? { deadline: opts.deadline } : {}),
|
|
761
|
+
...(opts.scope !== undefined ? { scope: opts.scope } : {}),
|
|
762
|
+
...(opts.stop !== undefined ? { stop: opts.stop } : {}),
|
|
763
|
+
...(opts.priority !== undefined ? { priority: opts.priority } : {}),
|
|
764
|
+
});
|
|
765
|
+
event = {
|
|
766
|
+
type: 'mission.reply', missionId, sequence: lineEvent.sequence,
|
|
767
|
+
text: lineEvent.text, done: lineEvent.done, createdAt: lineEvent.createdAt,
|
|
768
|
+
...fields,
|
|
769
|
+
...(lineEvent.deadline ? { deadline: lineEvent.deadline } : {}),
|
|
770
|
+
};
|
|
771
|
+
} catch (error) {
|
|
772
|
+
if (error instanceof MissionLineHttpError && error.status < 500) throw error;
|
|
773
|
+
debug.log('agent-mission', 'line-ingress-fallback', { missionId, error: redactSecretText(String(error)) });
|
|
774
|
+
const replyStore = await replyStoreAt(missionId);
|
|
775
|
+
const persistedLine = replyStore.replies(missionId).find((reply) => reply.lineId === lineId);
|
|
776
|
+
if (persistedLine) event = persistedLine;
|
|
777
|
+
else {
|
|
778
|
+
const existingReplies = replyStore.replies(missionId);
|
|
779
|
+
const mission = replyStore.read(missionId);
|
|
780
|
+
event = await replyStore.reply(missionId, text, opts.done ?? false, {
|
|
781
|
+
...fields,
|
|
782
|
+
...(existingReplies.length === 0 && mission ? {
|
|
783
|
+
who: lineAgent === 'claude' ? 'Claude' : 'Codex',
|
|
784
|
+
what: mission.prompt.replace(/\s+/g, ' ').trim().slice(0, 180) || 'hand mission',
|
|
785
|
+
} : {}),
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
const linkedStore = await replyStoreAt(missionId);
|
|
790
|
+
await syncAcceptedLinearReply(linkedStore, missionId, event);
|
|
791
|
+
if (opts.kind === 'ask') {
|
|
792
|
+
const answerStore = await replyStoreAt(missionId);
|
|
793
|
+
const answer = await waitForMissionAnswer(answerStore, missionId, event, opts.defaults!);
|
|
794
|
+
out(opts, { missionId, accepted: true, sequence: event.sequence, done: event.done, answer: answer.text, usedDefault: answer.usedDefault });
|
|
795
|
+
} else out(opts, { missionId, accepted: true, sequence: event.sequence, done: event.done });
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
const replyStore = await replyStoreAt(missionId);
|
|
799
|
+
const event = await replyStore.reply(missionId, text, opts.done ?? false, {
|
|
800
|
+
...(opts.kind !== undefined ? { kind: opts.kind } : {}),
|
|
801
|
+
...(opts.defaults !== undefined ? { defaults: opts.defaults } : {}),
|
|
802
|
+
...(opts.deadline !== undefined ? { deadline: opts.deadline } : {}),
|
|
803
|
+
...(opts.scope !== undefined ? { scope: opts.scope } : {}),
|
|
804
|
+
...(opts.stop !== undefined ? { stop: opts.stop } : {}),
|
|
805
|
+
...(opts.priority !== undefined ? { priority: opts.priority } : {}),
|
|
806
|
+
});
|
|
807
|
+
await syncAcceptedLinearReply(replyStore, missionId, event);
|
|
808
|
+
if (opts.kind === 'ask') {
|
|
809
|
+
const answer = await waitForMissionAnswer(replyStore, missionId, event, opts.defaults!);
|
|
810
|
+
out(opts, { missionId, accepted: true, sequence: event.sequence, done: event.done, answer: answer.text, usedDefault: answer.usedDefault });
|
|
811
|
+
} else out(opts, { missionId, accepted: true, sequence: event.sequence, done: event.done });
|
|
812
|
+
} catch (e) { error(`${String(e)}\n`); process.exitCode = 1; }
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
cmd.command('cancel <missionId>')
|
|
816
|
+
.option('--json', 'Emit JSON').option('--output-format <format>', 'text or json', 'text')
|
|
817
|
+
.action(async (missionId: string, opts: { json?: boolean; outputFormat?: string; usage?: boolean }, command: Command) => {
|
|
818
|
+
if (opts.usage || command.optsWithGlobals().usage) { out({ json: true }, missionUsage.commands.cancel); return; }
|
|
819
|
+
const store = await storeAt();
|
|
820
|
+
try {
|
|
821
|
+
const { record, transitioned } = await store.cancel(missionId);
|
|
822
|
+
if (record.workerPid && transitioned) {
|
|
823
|
+
try { process.kill(-record.workerPid, 'SIGTERM'); } catch { try { process.kill(record.workerPid, 'SIGTERM'); } catch { /* worker already exited */ } }
|
|
824
|
+
}
|
|
825
|
+
out(opts, { id: missionId, missionId, status: record.status === 'completed' ? 'done' : record.status, cancelled: record.status === 'cancelled' });
|
|
826
|
+
} catch (e) { error(`${String(e)}\n`); process.exitCode = 1; }
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
cmd.command('__worker <missionId>', { hidden: true }).action(async (missionId: string) => {
|
|
830
|
+
await runMissionOutWorker(await root(), missionId);
|
|
831
|
+
});
|
|
832
|
+
return cmd;
|
|
833
|
+
}
|