agentix-cli 0.46.1 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-QTUGMHG7.js → App-RZDJH6MK.js} +2 -2
- package/dist/{ChatApp-634FDG3W.js → ChatApp-6TXOFUDH.js} +2 -2
- package/dist/{agent-LI3AZQBC.js → agent-ZEVB6LE4.js} +2 -2
- package/dist/{board-dashboard-5JTHHIFU.js → board-dashboard-GADOZ7XY.js} +4 -4
- package/dist/{chunk-JTOKOQHQ.js → chunk-3AZ2OZMU.js} +107 -107
- package/dist/chunk-3AZ2OZMU.js.map +1 -0
- package/dist/{chunk-QJANPP4C.js → chunk-ANLKBCYH.js} +6 -6
- package/dist/{chunk-QJANPP4C.js.map → chunk-ANLKBCYH.js.map} +1 -1
- package/dist/{chunk-7A7RC3R4.js → chunk-BHPIAG3E.js} +2 -2
- package/dist/{chunk-RY2EULHS.js → chunk-BJWK7FPT.js} +2 -2
- package/dist/{chunk-6HMZ5TTM.js → chunk-BZLHS3VF.js} +2 -2
- package/dist/{chunk-QLTM3F7M.js → chunk-DJQA2CWD.js} +10 -10
- package/dist/{chunk-QLTM3F7M.js.map → chunk-DJQA2CWD.js.map} +1 -1
- package/dist/{chunk-V5FZJUK4.js → chunk-FNLGY4UV.js} +2 -2
- package/dist/{chunk-V5FZJUK4.js.map → chunk-FNLGY4UV.js.map} +1 -1
- package/dist/{chunk-NVVXVUQU.js → chunk-FPXYQ4IM.js} +2 -2
- package/dist/{chunk-WLVQDEOT.js → chunk-GPQTI5KD.js} +2 -2
- package/dist/{chunk-NSYY5NCR.js → chunk-J63MRNXF.js} +2 -2
- package/dist/{chunk-IMAAMJ74.js → chunk-KFXLQNDQ.js} +130 -126
- package/dist/chunk-KFXLQNDQ.js.map +1 -0
- package/dist/{chunk-SGFXE5FP.js → chunk-KTM7HSEB.js} +2 -2
- package/dist/chunk-L53FTKEP.js +3 -0
- package/dist/chunk-L53FTKEP.js.map +1 -0
- package/dist/{chunk-TNFOGJWZ.js → chunk-MDTKQZC6.js} +2 -2
- package/dist/{chunk-ICZPZYYR.js → chunk-NXJBAKBR.js} +2 -2
- package/dist/{chunk-TCJ3SMOF.js → chunk-PTFW5TYY.js} +2 -2
- package/dist/{chunk-2TJ5L7CB.js → chunk-SFLF64Q3.js} +2 -2
- package/dist/{chunk-BIFJSQB5.js → chunk-VCT7ZPIA.js} +2 -2
- package/dist/{chunk-E6EW42EA.js → chunk-VHTFHGVW.js} +2 -2
- package/dist/{chunk-CTCOWVNL.js → chunk-VZDKE2EZ.js} +2 -2
- package/dist/{chunk-LGBBKLUO.js → chunk-W544ZCCO.js} +2 -2
- package/dist/{chunk-LUSFRS7R.js → chunk-WCAKT4FN.js} +2 -2
- package/dist/chunk-WZGABQ72.js +59 -0
- package/dist/chunk-WZGABQ72.js.map +1 -0
- package/dist/{chunk-GAUQOIEE.js → chunk-ZYL3TO4I.js} +54 -54
- package/dist/chunk-ZYL3TO4I.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client-LAIP23IP.js +2 -0
- package/dist/config-OZ2OOKFA.js +2 -0
- package/dist/config-mutator-EUF7QQ4V.js +2 -0
- package/dist/doctor-PEE3F5TX.js +2 -0
- package/dist/index.d.ts +142 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/program-3IZMYDWS.js +2 -0
- package/dist/{promote-R6WVBMT7.js → promote-RNSGW4AJ.js} +2 -2
- package/dist/query-BOUVRUU4.js +2 -0
- package/dist/registry-GROS7A2D.js +2 -0
- package/dist/{request-planner-KYQCJDAW.js → request-planner-5354IOYM.js} +2 -2
- package/dist/{review-candidates-ROFQR6XE.js → review-candidates-UTWMO7UO.js} +2 -2
- package/dist/{routing-OC3QJI3W.js → routing-JGNWB6VJ.js} +2 -2
- package/dist/{schedule-tool-VQCNMBJF.js → schedule-tool-3EFQMD2F.js} +2 -2
- package/dist/scheduler-NT4YXVA6.js +2 -0
- package/dist/{seat-3WT3VJC2.js → seat-STLDEYSO.js} +2 -2
- package/dist/{select-KPQWIC22.js → select-VP66P6XB.js} +2 -2
- package/dist/shutdown-6GCMKYAD.js +2 -0
- package/dist/{surface-usage-UREILT2E.js → surface-usage-FM2ZHGYE.js} +2 -2
- package/dist/wiki-SKIIAVCU.js +2 -0
- package/dist/wiki-SKIIAVCU.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-GAUQOIEE.js.map +0 -1
- package/dist/chunk-IMAAMJ74.js.map +0 -1
- package/dist/chunk-JTOKOQHQ.js.map +0 -1
- package/dist/chunk-VMDA2SX2.js +0 -43
- package/dist/chunk-VMDA2SX2.js.map +0 -1
- package/dist/client-NTC667CA.js +0 -2
- package/dist/config-5V444ZFW.js +0 -2
- package/dist/config-mutator-E6NQLFWR.js +0 -2
- package/dist/doctor-7Z4VLXC4.js +0 -2
- package/dist/program-X26USJYH.js +0 -2
- package/dist/query-6EMTLCHQ.js +0 -2
- package/dist/registry-STML35CV.js +0 -2
- package/dist/scheduler-NRXPVG7P.js +0 -2
- package/dist/wiki-LGHX3WPI.js +0 -2
- /package/dist/{App-QTUGMHG7.js.map → App-RZDJH6MK.js.map} +0 -0
- /package/dist/{ChatApp-634FDG3W.js.map → ChatApp-6TXOFUDH.js.map} +0 -0
- /package/dist/{agent-LI3AZQBC.js.map → agent-ZEVB6LE4.js.map} +0 -0
- /package/dist/{board-dashboard-5JTHHIFU.js.map → board-dashboard-GADOZ7XY.js.map} +0 -0
- /package/dist/{chunk-7A7RC3R4.js.map → chunk-BHPIAG3E.js.map} +0 -0
- /package/dist/{chunk-RY2EULHS.js.map → chunk-BJWK7FPT.js.map} +0 -0
- /package/dist/{chunk-6HMZ5TTM.js.map → chunk-BZLHS3VF.js.map} +0 -0
- /package/dist/{chunk-NVVXVUQU.js.map → chunk-FPXYQ4IM.js.map} +0 -0
- /package/dist/{chunk-WLVQDEOT.js.map → chunk-GPQTI5KD.js.map} +0 -0
- /package/dist/{chunk-NSYY5NCR.js.map → chunk-J63MRNXF.js.map} +0 -0
- /package/dist/{chunk-SGFXE5FP.js.map → chunk-KTM7HSEB.js.map} +0 -0
- /package/dist/{chunk-TNFOGJWZ.js.map → chunk-MDTKQZC6.js.map} +0 -0
- /package/dist/{chunk-ICZPZYYR.js.map → chunk-NXJBAKBR.js.map} +0 -0
- /package/dist/{chunk-TCJ3SMOF.js.map → chunk-PTFW5TYY.js.map} +0 -0
- /package/dist/{chunk-2TJ5L7CB.js.map → chunk-SFLF64Q3.js.map} +0 -0
- /package/dist/{chunk-BIFJSQB5.js.map → chunk-VCT7ZPIA.js.map} +0 -0
- /package/dist/{chunk-E6EW42EA.js.map → chunk-VHTFHGVW.js.map} +0 -0
- /package/dist/{chunk-CTCOWVNL.js.map → chunk-VZDKE2EZ.js.map} +0 -0
- /package/dist/{chunk-LGBBKLUO.js.map → chunk-W544ZCCO.js.map} +0 -0
- /package/dist/{chunk-LUSFRS7R.js.map → chunk-WCAKT4FN.js.map} +0 -0
- /package/dist/{client-NTC667CA.js.map → client-LAIP23IP.js.map} +0 -0
- /package/dist/{config-5V444ZFW.js.map → config-OZ2OOKFA.js.map} +0 -0
- /package/dist/{config-mutator-E6NQLFWR.js.map → config-mutator-EUF7QQ4V.js.map} +0 -0
- /package/dist/{doctor-7Z4VLXC4.js.map → doctor-PEE3F5TX.js.map} +0 -0
- /package/dist/{program-X26USJYH.js.map → program-3IZMYDWS.js.map} +0 -0
- /package/dist/{promote-R6WVBMT7.js.map → promote-RNSGW4AJ.js.map} +0 -0
- /package/dist/{query-6EMTLCHQ.js.map → query-BOUVRUU4.js.map} +0 -0
- /package/dist/{registry-STML35CV.js.map → registry-GROS7A2D.js.map} +0 -0
- /package/dist/{request-planner-KYQCJDAW.js.map → request-planner-5354IOYM.js.map} +0 -0
- /package/dist/{review-candidates-ROFQR6XE.js.map → review-candidates-UTWMO7UO.js.map} +0 -0
- /package/dist/{routing-OC3QJI3W.js.map → routing-JGNWB6VJ.js.map} +0 -0
- /package/dist/{schedule-tool-VQCNMBJF.js.map → schedule-tool-3EFQMD2F.js.map} +0 -0
- /package/dist/{scheduler-NRXPVG7P.js.map → scheduler-NT4YXVA6.js.map} +0 -0
- /package/dist/{seat-3WT3VJC2.js.map → seat-STLDEYSO.js.map} +0 -0
- /package/dist/{select-KPQWIC22.js.map → select-VP66P6XB.js.map} +0 -0
- /package/dist/{surface-usage-UREILT2E.js.map → shutdown-6GCMKYAD.js.map} +0 -0
- /package/dist/{wiki-LGHX3WPI.js.map → surface-usage-FM2ZHGYE.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as n}from"./chunk-3AZ2OZMU.js";import"./chunk-BHPIAG3E.js";import"./chunk-VHTFHGVW.js";import"./chunk-SFLF64Q3.js";import"./chunk-7CVJ4JOE.js";import"./chunk-W544ZCCO.js";import"./chunk-GPQTI5KD.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SZDACK6O.js";import"./chunk-KFXLQNDQ.js";import"./chunk-WCAKT4FN.js";import"./chunk-FNLGY4UV.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-L53FTKEP.js";import"./chunk-ZYL3TO4I.js";import"./chunk-PTFW5TYY.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.js";import"./chunk-DP7RTNDM.js";import"./chunk-FPXYQ4IM.js";import"./chunk-SFQUP3BP.js";import"./chunk-VCT7ZPIA.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-VDMYBPYB.js";import"./chunk-DSYKYZMT.js";import"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/signal-exit.ts","../src/cli.ts"],"sourcesContent":["// --- Ctrl-C / SIGTERM for CLI commands ---\n//\n// Short commands should exit at once when stopped. Long-running ones (the\n// daemon above all) install their own handler to finish in-flight work first.\n// The CLI's quick exit used to be registered unconditionally, before the\n// daemon's, and Node runs listeners in registration order — so every stop\n// exited the process before the daemon's drain began and killed in-flight\n// agent tasks mid-turn (#103). Now the quick exit only fires when nobody\n// else handles the signal.\n\ntype SignalTarget = Pick<NodeJS.Process, \"on\" | \"listenerCount\" | \"exit\">\n\nexport const CLI_EXIT_SIGNALS = [\"SIGINT\", \"SIGTERM\"] as const\n\nexport function installCliSignalExit(proc: SignalTarget = process): void {\n for (const sig of CLI_EXIT_SIGNALS) {\n proc.on(sig, () => {\n // This listener is always one of them; anything more means a command\n // is handling the stop itself.\n if (proc.listenerCount(sig) <= 1) proc.exit(0)\n })\n }\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"@/program\"\nimport { installCliSignalExit } from \"@/utils/signal-exit\"\n\ninstallCliSignalExit()\n\nasync function main() {\n const program = await buildProgram()\n\n const args = process.argv.slice(2)\n if (args.length === 0) {\n program.outputHelp()\n return\n }\n\n program.parse()\n}\n\nmain()\n"],"mappings":";wkDAYO,IAAMA,EAAmB,CAAC,SAAU,SAAS,EAE7C,SAASC,EAAqBC,EAAqB,QAAe,CACvE,QAAWC,KAAOH,EAChBE,EAAK,GAAGC,EAAK,IAAM,CAGbD,EAAK,cAAcC,CAAG,GAAK,GAAGD,EAAK,KAAK,CAAC,CAC/C,CAAC,CAEL,CClBAE,EAAqB,EAErB,eAAeC,GAAO,CACpB,IAAMC,EAAU,MAAMC,EAAa,EAGnC,GADa,QAAQ,KAAK,MAAM,CAAC,EACxB,SAAW,EAAG,CACrBD,EAAQ,WAAW,EACnB,OAGFA,EAAQ,MAAM,CAChB,CAEAD,EAAK","names":["CLI_EXIT_SIGNALS","installCliSignalExit","proc","sig","installCliSignalExit","main","program","buildProgram"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3828,6 +3828,54 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3828
3828
|
accountId?: string | undefined;
|
|
3829
3829
|
} | undefined;
|
|
3830
3830
|
}>>;
|
|
3831
|
+
/** What happens to runs a restart cuts off (agents/resume). Chat messages
|
|
3832
|
+
* are resumed in their chat; scheduled jobs never are (the next run
|
|
3833
|
+
* covers them); everything else is reported unless its channel is in
|
|
3834
|
+
* directChannels. */
|
|
3835
|
+
resume: z.ZodDefault<z.ZodObject<{
|
|
3836
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
3837
|
+
/** Older runs are reported, not resumed. */
|
|
3838
|
+
maxAgeMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3839
|
+
/** A run cut off while resuming is not retried past this. */
|
|
3840
|
+
maxAttempts: z.ZodDefault<z.ZodNumber>;
|
|
3841
|
+
/** Channels whose runs are only reported, even from a chat. */
|
|
3842
|
+
reportOnlyChannels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
3843
|
+
/** Non-chat runs (voice, agent-to-agent, webhooks…) resumed on these
|
|
3844
|
+
* channels. Their answer isn't delivered anywhere; opt in only for
|
|
3845
|
+
* runs whose work is the point. */
|
|
3846
|
+
directChannels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
3847
|
+
/** This many restarts within the window pauses resuming. */
|
|
3848
|
+
crashLoop: z.ZodDefault<z.ZodObject<{
|
|
3849
|
+
restarts: z.ZodDefault<z.ZodNumber>;
|
|
3850
|
+
windowMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3851
|
+
}, "strip", z.ZodTypeAny, {
|
|
3852
|
+
restarts: number;
|
|
3853
|
+
windowMinutes: number;
|
|
3854
|
+
}, {
|
|
3855
|
+
restarts?: number | undefined;
|
|
3856
|
+
windowMinutes?: number | undefined;
|
|
3857
|
+
}>>;
|
|
3858
|
+
}, "strip", z.ZodTypeAny, {
|
|
3859
|
+
enabled: boolean;
|
|
3860
|
+
maxAgeMinutes: number;
|
|
3861
|
+
maxAttempts: number;
|
|
3862
|
+
reportOnlyChannels: string[];
|
|
3863
|
+
directChannels: string[];
|
|
3864
|
+
crashLoop: {
|
|
3865
|
+
restarts: number;
|
|
3866
|
+
windowMinutes: number;
|
|
3867
|
+
};
|
|
3868
|
+
}, {
|
|
3869
|
+
enabled?: boolean | undefined;
|
|
3870
|
+
maxAgeMinutes?: number | undefined;
|
|
3871
|
+
maxAttempts?: number | undefined;
|
|
3872
|
+
reportOnlyChannels?: string[] | undefined;
|
|
3873
|
+
directChannels?: string[] | undefined;
|
|
3874
|
+
crashLoop?: {
|
|
3875
|
+
restarts?: number | undefined;
|
|
3876
|
+
windowMinutes?: number | undefined;
|
|
3877
|
+
} | undefined;
|
|
3878
|
+
}>>;
|
|
3831
3879
|
mesh: z.ZodDefault<z.ZodObject<{
|
|
3832
3880
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
3833
3881
|
peers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -5314,6 +5362,17 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5314
5362
|
allowActions?: boolean | undefined;
|
|
5315
5363
|
} | undefined;
|
|
5316
5364
|
}>;
|
|
5365
|
+
resume: {
|
|
5366
|
+
enabled: boolean;
|
|
5367
|
+
maxAgeMinutes: number;
|
|
5368
|
+
maxAttempts: number;
|
|
5369
|
+
reportOnlyChannels: string[];
|
|
5370
|
+
directChannels: string[];
|
|
5371
|
+
crashLoop: {
|
|
5372
|
+
restarts: number;
|
|
5373
|
+
windowMinutes: number;
|
|
5374
|
+
};
|
|
5375
|
+
};
|
|
5317
5376
|
mesh: {
|
|
5318
5377
|
enabled: boolean;
|
|
5319
5378
|
peers: {
|
|
@@ -5869,6 +5928,17 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5869
5928
|
allowActions?: boolean | undefined;
|
|
5870
5929
|
} | undefined;
|
|
5871
5930
|
}> | undefined;
|
|
5931
|
+
resume?: {
|
|
5932
|
+
enabled?: boolean | undefined;
|
|
5933
|
+
maxAgeMinutes?: number | undefined;
|
|
5934
|
+
maxAttempts?: number | undefined;
|
|
5935
|
+
reportOnlyChannels?: string[] | undefined;
|
|
5936
|
+
directChannels?: string[] | undefined;
|
|
5937
|
+
crashLoop?: {
|
|
5938
|
+
restarts?: number | undefined;
|
|
5939
|
+
windowMinutes?: number | undefined;
|
|
5940
|
+
} | undefined;
|
|
5941
|
+
} | undefined;
|
|
5872
5942
|
mesh?: {
|
|
5873
5943
|
enabled?: boolean | undefined;
|
|
5874
5944
|
peers?: {
|
|
@@ -6703,6 +6773,13 @@ declare class AgentXDaemon {
|
|
|
6703
6773
|
start(): Promise<void>;
|
|
6704
6774
|
stop(): Promise<void>;
|
|
6705
6775
|
private midnightTimer?;
|
|
6776
|
+
/** Set on the first stop signal: new work is refused while tasks drain. */
|
|
6777
|
+
private shuttingDown;
|
|
6778
|
+
/** Runs the previous daemon left in flight (agents/resume). */
|
|
6779
|
+
private interruptedRuns;
|
|
6780
|
+
private bootTimes;
|
|
6781
|
+
/** Resume, report or skip each run the last restart cut off. Never throws. */
|
|
6782
|
+
private resumeInterruptedRuns;
|
|
6706
6783
|
/**
|
|
6707
6784
|
* Watch agentx.json for external edits (e.g. `agentx config set ...`) and
|
|
6708
6785
|
* reload cron jobs + in-memory config. Channels / agents / mesh changes
|
|
@@ -7021,6 +7098,21 @@ declare class TokenTracker {
|
|
|
7021
7098
|
private save;
|
|
7022
7099
|
}
|
|
7023
7100
|
|
|
7101
|
+
interface RouterOrigin {
|
|
7102
|
+
kind: "router";
|
|
7103
|
+
/** Channel adapter name. */
|
|
7104
|
+
adapter: string;
|
|
7105
|
+
/** The incoming message, as the router's inflight log stores it. */
|
|
7106
|
+
message: Record<string, unknown>;
|
|
7107
|
+
}
|
|
7108
|
+
interface DirectOrigin {
|
|
7109
|
+
kind: "direct";
|
|
7110
|
+
context?: Record<string, unknown>;
|
|
7111
|
+
model?: string;
|
|
7112
|
+
autonomy?: string;
|
|
7113
|
+
}
|
|
7114
|
+
type RunOrigin = RouterOrigin | DirectOrigin;
|
|
7115
|
+
|
|
7024
7116
|
interface FriendlyError {
|
|
7025
7117
|
/** One-line, operator-facing message suitable for a dashboard card or chat reply. */
|
|
7026
7118
|
message: string;
|
|
@@ -7117,6 +7209,13 @@ interface IncomingMessage {
|
|
|
7117
7209
|
* Carried alongside the path so per-project customisation applies
|
|
7118
7210
|
* without the registry re-reading the rule. */
|
|
7119
7211
|
runbookFiles?: string[];
|
|
7212
|
+
/** Set when this message re-runs one a restart cut off (agents/resume):
|
|
7213
|
+
* the note for the agent, the attempt number, and the run it continues. */
|
|
7214
|
+
resume?: {
|
|
7215
|
+
note: string;
|
|
7216
|
+
attempt: number;
|
|
7217
|
+
resumedFrom: string;
|
|
7218
|
+
};
|
|
7120
7219
|
}
|
|
7121
7220
|
interface OutgoingMessage {
|
|
7122
7221
|
channel: string;
|
|
@@ -7257,6 +7356,12 @@ interface AgentTask {
|
|
|
7257
7356
|
/** Called with `runningTaskId` as soon as the run starts. Never fires for
|
|
7258
7357
|
* a message that was queued or dropped instead of run. */
|
|
7259
7358
|
onStart?: (runningTaskId: string) => void;
|
|
7359
|
+
/** How to re-enter this run if a restart cuts it off (agents/resume).
|
|
7360
|
+
* Absent: recorded as a direct run with this task's context. */
|
|
7361
|
+
origin?: RunOrigin;
|
|
7362
|
+
/** Set on a run that resumes one cut off by a restart. */
|
|
7363
|
+
resumeAttempt?: number;
|
|
7364
|
+
resumedFrom?: string;
|
|
7260
7365
|
/** Improvement plan #8 — when true, the dispatcher discards any
|
|
7261
7366
|
* cached session for this (agent, channel, chatId) before
|
|
7262
7367
|
* executing: the claudeSessionId is cleared (no --resume) and
|
|
@@ -9288,14 +9393,14 @@ declare class AgentRegistry {
|
|
|
9288
9393
|
totalInput: number;
|
|
9289
9394
|
totalOutput: number;
|
|
9290
9395
|
totalCacheRead: number;
|
|
9291
|
-
totalCacheCreate: number;
|
|
9396
|
+
totalCacheCreate: number;
|
|
9397
|
+
cacheHitRatio: number;
|
|
9398
|
+
totalErrors: number; /** Workflow auto-runner — invoked when workflow matching is in `mode: "auto"`
|
|
9292
9399
|
* and a candidate workflow's confidence ≥ autoRunThreshold. Wired by the
|
|
9293
9400
|
* daemon after the workflow dispatcher is constructed. Returns the runId of
|
|
9294
9401
|
* the started workflow run; the workflow itself owns posting any reply via
|
|
9295
9402
|
* its `action.send` / `agent` nodes. Duck-typed to avoid a circular import
|
|
9296
9403
|
* on WorkflowDispatcher. */
|
|
9297
|
-
cacheHitRatio: number;
|
|
9298
|
-
totalErrors: number;
|
|
9299
9404
|
totalCost: number;
|
|
9300
9405
|
byAgent: Record<string, {
|
|
9301
9406
|
tasks: number;
|
|
@@ -10180,6 +10285,37 @@ declare class BusinessLayer {
|
|
|
10180
10285
|
summary(): string;
|
|
10181
10286
|
}
|
|
10182
10287
|
|
|
10288
|
+
/** A run that was still going when the previous daemon stopped. */
|
|
10289
|
+
interface InterruptedRun {
|
|
10290
|
+
taskId: string;
|
|
10291
|
+
agentId: string;
|
|
10292
|
+
channel: string | null;
|
|
10293
|
+
chatId: string | null;
|
|
10294
|
+
workflowRunId: string | null;
|
|
10295
|
+
startedAt: number;
|
|
10296
|
+
originalMessage: string | null;
|
|
10297
|
+
resumeOrigin: string | null;
|
|
10298
|
+
resumeAttempt: number;
|
|
10299
|
+
/** Tool calls it had made, in order, for the resume note. */
|
|
10300
|
+
toolCalls: Array<{
|
|
10301
|
+
action: string | null;
|
|
10302
|
+
inputSummary: string | null;
|
|
10303
|
+
}>;
|
|
10304
|
+
}
|
|
10305
|
+
|
|
10306
|
+
interface Resumer {
|
|
10307
|
+
/** Re-enter the run with the note prepended. Resolves once the run has
|
|
10308
|
+
* been handed over, not when it finishes. */
|
|
10309
|
+
resume(input: {
|
|
10310
|
+
origin: RunOrigin;
|
|
10311
|
+
run: InterruptedRun;
|
|
10312
|
+
note: string;
|
|
10313
|
+
attempt: number;
|
|
10314
|
+
}): Promise<void>;
|
|
10315
|
+
/** One line to the chat the run came from. */
|
|
10316
|
+
tell?(origin: RunOrigin, text: string): Promise<void>;
|
|
10317
|
+
}
|
|
10318
|
+
|
|
10183
10319
|
declare class MessageRouter {
|
|
10184
10320
|
private registry;
|
|
10185
10321
|
private config;
|
|
@@ -10308,6 +10444,9 @@ declare class MessageRouter {
|
|
|
10308
10444
|
* previous process committed to handling but crashed before completing.
|
|
10309
10445
|
*/
|
|
10310
10446
|
private replayInflight;
|
|
10447
|
+
/** Re-enter chat messages a restart cut off (agents/resume). The message
|
|
10448
|
+
* goes through the normal path, so its answer lands in the same chat. */
|
|
10449
|
+
createResumer(): Resumer;
|
|
10311
10450
|
stopAll(): Promise<void>;
|
|
10312
10451
|
/**
|
|
10313
10452
|
* Returns true if this message id was processed within MESSAGE_ID_TTL_MS.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-W5C2GDNC.js";import{Y as bt,Z as Tt,_ as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-W5C2GDNC.js";import{Y as bt,Z as Tt,_ as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt}from"./chunk-KFXLQNDQ.js";import"./chunk-WCAKT4FN.js";import"./chunk-FNLGY4UV.js";import"./chunk-V7FYSZSV.js";import"./chunk-ZVP6GB4G.js";import"./chunk-7L6M3P2N.js";import"./chunk-VZDKE2EZ.js";import"./chunk-3SCPRYJB.js";import"./chunk-FRHSQVFN.js";import"./chunk-L53FTKEP.js";import{O as yt,l as lt,m as ct,n as dt,o as mt,p as pt}from"./chunk-ZYL3TO4I.js";import"./chunk-PTFW5TYY.js";import"./chunk-DJQA2CWD.js";import"./chunk-WZGABQ72.js";import"./chunk-DP7RTNDM.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-FPXYQ4IM.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import{k as ut}from"./chunk-VCT7ZPIA.js";import"./chunk-WPMX3VGI.js";import"./chunk-K33GIBSE.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-J63MRNXF.js";import"./chunk-NXJBAKBR.js";import"./chunk-DWADWDMU.js";import"./chunk-CQR6C5FU.js";import"./chunk-VWTBHLMX.js";import"./chunk-BJWK7FPT.js";import{a as gt,b as ft,e as ht}from"./chunk-KTM7HSEB.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import"./chunk-MDTKQZC6.js";import"./chunk-AJ5RMU7X.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-BZLHS3VF.js";import"./chunk-F4HZTZHW.js";import"./chunk-AJONZWLT.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-LCIREYTD.js";import{a as m,b as G}from"./chunk-L2WSPY6S.js";import{a as Fe,b as Le,c as A,d as De}from"./chunk-VDMYBPYB.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{j as tt,l as st,m as ot,o as nt}from"./chunk-ANLKBCYH.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
|
|
2
2
|
`)}
|
|
3
3
|
|
|
4
4
|
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-BOKE5M5S.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
|