@agntk/agent-harness 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/{agent-framework-K4GUIICH.js → agent-framework-CMFC3VJM.js} +8 -8
  2. package/dist/{auto-processor-OLE45UI3.js → auto-processor-SDAJF67T.js} +3 -3
  3. package/dist/{chunk-XTBKL5BI.js → chunk-2ENYRENZ.js} +2 -2
  4. package/dist/{chunk-UPLBF4RZ.js → chunk-2UVWCTAY.js} +2 -2
  5. package/dist/{chunk-4CWAGBNS.js → chunk-4TQQZILG.js} +73 -3
  6. package/dist/chunk-4TQQZILG.js.map +1 -0
  7. package/dist/{chunk-A7BJPQQ6.js → chunk-5O5OGOOQ.js} +2 -2
  8. package/dist/{chunk-UWQTZMNI.js → chunk-7GZ4D6V6.js} +2 -2
  9. package/dist/{chunk-FLZU44SV.js → chunk-AN6Y4MDD.js} +6 -6
  10. package/dist/{chunk-4FDUOGSZ.js → chunk-D7AWV24Z.js} +3 -3
  11. package/dist/{chunk-CHJ5GNZC.js → chunk-EC42HQQH.js} +2 -2
  12. package/dist/{chunk-274RV3YO.js → chunk-GX2RCSFJ.js} +3 -3
  13. package/dist/{chunk-GJNNR2RA.js → chunk-M6PDMK2O.js} +3 -3
  14. package/dist/{chunk-GUJTBGVS.js → chunk-MSO7DKBK.js} +99 -188
  15. package/dist/chunk-MSO7DKBK.js.map +1 -0
  16. package/dist/{chunk-CSL3ERUI.js → chunk-NBEAK63K.js} +3 -3
  17. package/dist/{chunk-DA7IKHC4.js → chunk-NOJW5KG2.js} +2 -2
  18. package/dist/{chunk-M7NXUK55.js → chunk-NVC2WY4K.js} +2 -2
  19. package/dist/{chunk-YIJY5DBV.js → chunk-P74KXHA4.js} +4 -4
  20. package/dist/{chunk-YUFNYN2H.js → chunk-PTQ37NRI.js} +4 -4
  21. package/dist/{chunk-KFX54TQM.js → chunk-RPBC2QOA.js} +73 -3
  22. package/dist/chunk-RPBC2QOA.js.map +1 -0
  23. package/dist/{chunk-RY3ZFII7.js → chunk-SEHAQTBO.js} +6 -6
  24. package/dist/{chunk-MPZ3BPUI.js → chunk-UMXPOYZR.js} +4 -4
  25. package/dist/{chunk-W4T7PGI2.js → chunk-UXCHAS3Z.js} +4 -4
  26. package/dist/chunk-XVFVTDE6.js +98 -0
  27. package/dist/chunk-XVFVTDE6.js.map +1 -0
  28. package/dist/cli/index.js +105 -104
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/{config-WVMRUOCA.js → config-2O6S2YJO.js} +3 -3
  31. package/dist/config-LLQZYN2Q.js +11 -0
  32. package/dist/{context-loader-3ORBPMHJ.js → context-loader-XCZ5EXNG.js} +4 -4
  33. package/dist/{conversation-QDEIDQPH.js → conversation-OPLE23IM.js} +6 -6
  34. package/dist/{delegate-VJCJLYEK.js → delegate-ZJCIADNN.js} +7 -7
  35. package/dist/{export-6GCYHEHQ.js → export-2HEAAOUF.js} +3 -3
  36. package/dist/{graph-YUIPOSOO.js → graph-5MKRTC3J.js} +4 -4
  37. package/dist/harness-ABKZWP47.js +11 -0
  38. package/dist/{harness-WE4SLCML.js → harness-XSBQBY7T.js} +8 -8
  39. package/dist/index.d.ts +22 -0
  40. package/dist/index.js +226 -6
  41. package/dist/index.js.map +1 -1
  42. package/dist/{indexer-LONANRRM.js → indexer-YKSGUVYT.js} +4 -4
  43. package/dist/{instinct-learner-SRM72DHF.js → instinct-learner-CWVMLUWX.js} +5 -5
  44. package/dist/{intake-4M3HNU43.js → intake-M5NRR6QR.js} +5 -5
  45. package/dist/{intelligence-HJOCA4SJ.js → intelligence-UW4TCOC7.js} +10 -10
  46. package/dist/{journal-WANJL3MI.js → journal-KN265YLU.js} +5 -5
  47. package/dist/{loader-C3TKIKZR.js → loader-BOCVXVCH.js} +3 -3
  48. package/dist/{mcp-installer-6O2XXD3V.js → mcp-installer-KV3XZRRF.js} +3 -3
  49. package/dist/{primitive-registry-I6VTIR4W.js → primitive-registry-HOJMUFBT.js} +3 -3
  50. package/dist/{rule-engine-YGQ3RYZM.js → rule-engine-I4AFQSSR.js} +3 -3
  51. package/dist/{scaffold-A3VRRCBV.js → scaffold-ZY4XWINP.js} +4 -4
  52. package/dist/{scheduler-XHHIVHRI.js → scheduler-TYOQKO4C.js} +11 -11
  53. package/dist/{search-V3W5JMJG.js → search-4IYM525O.js} +3 -3
  54. package/dist/{semantic-search-2DTOO5UX.js → semantic-search-G624D6CI.js} +3 -3
  55. package/dist/{serve-DTQ3HENY.js → serve-QFUZWOU3.js} +9 -9
  56. package/dist/{telemetry-UC6PBXC7.js → telemetry-MVDNGJEC.js} +4 -4
  57. package/dist/{tool-executor-MJ7IG7PQ.js → tool-executor-KEYQLO4M.js} +5 -5
  58. package/dist/{tools-DZ4KETET.js → tools-EB3BHRRF.js} +4 -4
  59. package/dist/{types-EW7AIB3R.js → types-NYKB2DN3.js} +2 -2
  60. package/dist/{types-WGDLSPO6.js → types-VRSXU4AM.js} +2 -2
  61. package/dist/{universal-installer-EVBDGOWM.js → universal-installer-7MFCJUW7.js} +228 -6
  62. package/dist/universal-installer-7MFCJUW7.js.map +1 -0
  63. package/dist/{validator-7WXMDIHH.js → validator-LZXBFEPV.js} +8 -8
  64. package/dist/{verification-gate-FYXUX6LH.js → verification-gate-ALSJVKSW.js} +3 -3
  65. package/dist/{watcher-ISJC7YKL.js → watcher-CSHVDOCM.js} +5 -5
  66. package/dist/{web-server-DD7ZOP46.js → web-server-7NGOTK7J.js} +8 -8
  67. package/dist/web-server-7NGOTK7J.js.map +1 -0
  68. package/package.json +1 -1
  69. package/dist/chunk-4CWAGBNS.js.map +0 -1
  70. package/dist/chunk-GUJTBGVS.js.map +0 -1
  71. package/dist/chunk-KFX54TQM.js.map +0 -1
  72. package/dist/harness-LCHA3DWP.js +0 -10
  73. package/dist/universal-installer-EVBDGOWM.js.map +0 -1
  74. /package/dist/{agent-framework-K4GUIICH.js.map → agent-framework-CMFC3VJM.js.map} +0 -0
  75. /package/dist/{auto-processor-OLE45UI3.js.map → auto-processor-SDAJF67T.js.map} +0 -0
  76. /package/dist/{chunk-XTBKL5BI.js.map → chunk-2ENYRENZ.js.map} +0 -0
  77. /package/dist/{chunk-UPLBF4RZ.js.map → chunk-2UVWCTAY.js.map} +0 -0
  78. /package/dist/{chunk-A7BJPQQ6.js.map → chunk-5O5OGOOQ.js.map} +0 -0
  79. /package/dist/{chunk-UWQTZMNI.js.map → chunk-7GZ4D6V6.js.map} +0 -0
  80. /package/dist/{chunk-FLZU44SV.js.map → chunk-AN6Y4MDD.js.map} +0 -0
  81. /package/dist/{chunk-4FDUOGSZ.js.map → chunk-D7AWV24Z.js.map} +0 -0
  82. /package/dist/{chunk-CHJ5GNZC.js.map → chunk-EC42HQQH.js.map} +0 -0
  83. /package/dist/{chunk-274RV3YO.js.map → chunk-GX2RCSFJ.js.map} +0 -0
  84. /package/dist/{chunk-GJNNR2RA.js.map → chunk-M6PDMK2O.js.map} +0 -0
  85. /package/dist/{chunk-CSL3ERUI.js.map → chunk-NBEAK63K.js.map} +0 -0
  86. /package/dist/{chunk-DA7IKHC4.js.map → chunk-NOJW5KG2.js.map} +0 -0
  87. /package/dist/{chunk-M7NXUK55.js.map → chunk-NVC2WY4K.js.map} +0 -0
  88. /package/dist/{chunk-YIJY5DBV.js.map → chunk-P74KXHA4.js.map} +0 -0
  89. /package/dist/{chunk-YUFNYN2H.js.map → chunk-PTQ37NRI.js.map} +0 -0
  90. /package/dist/{chunk-RY3ZFII7.js.map → chunk-SEHAQTBO.js.map} +0 -0
  91. /package/dist/{chunk-MPZ3BPUI.js.map → chunk-UMXPOYZR.js.map} +0 -0
  92. /package/dist/{chunk-W4T7PGI2.js.map → chunk-UXCHAS3Z.js.map} +0 -0
  93. /package/dist/{config-WVMRUOCA.js.map → config-2O6S2YJO.js.map} +0 -0
  94. /package/dist/{context-loader-3ORBPMHJ.js.map → config-LLQZYN2Q.js.map} +0 -0
  95. /package/dist/{conversation-QDEIDQPH.js.map → context-loader-XCZ5EXNG.js.map} +0 -0
  96. /package/dist/{delegate-VJCJLYEK.js.map → conversation-OPLE23IM.js.map} +0 -0
  97. /package/dist/{graph-YUIPOSOO.js.map → delegate-ZJCIADNN.js.map} +0 -0
  98. /package/dist/{export-6GCYHEHQ.js.map → export-2HEAAOUF.js.map} +0 -0
  99. /package/dist/{harness-LCHA3DWP.js.map → graph-5MKRTC3J.js.map} +0 -0
  100. /package/dist/{harness-WE4SLCML.js.map → harness-ABKZWP47.js.map} +0 -0
  101. /package/dist/{indexer-LONANRRM.js.map → harness-XSBQBY7T.js.map} +0 -0
  102. /package/dist/{instinct-learner-SRM72DHF.js.map → indexer-YKSGUVYT.js.map} +0 -0
  103. /package/dist/{intake-4M3HNU43.js.map → instinct-learner-CWVMLUWX.js.map} +0 -0
  104. /package/dist/{journal-WANJL3MI.js.map → intake-M5NRR6QR.js.map} +0 -0
  105. /package/dist/{intelligence-HJOCA4SJ.js.map → intelligence-UW4TCOC7.js.map} +0 -0
  106. /package/dist/{loader-C3TKIKZR.js.map → journal-KN265YLU.js.map} +0 -0
  107. /package/dist/{telemetry-UC6PBXC7.js.map → loader-BOCVXVCH.js.map} +0 -0
  108. /package/dist/{mcp-installer-6O2XXD3V.js.map → mcp-installer-KV3XZRRF.js.map} +0 -0
  109. /package/dist/{primitive-registry-I6VTIR4W.js.map → primitive-registry-HOJMUFBT.js.map} +0 -0
  110. /package/dist/{rule-engine-YGQ3RYZM.js.map → rule-engine-I4AFQSSR.js.map} +0 -0
  111. /package/dist/{scaffold-A3VRRCBV.js.map → scaffold-ZY4XWINP.js.map} +0 -0
  112. /package/dist/{scheduler-XHHIVHRI.js.map → scheduler-TYOQKO4C.js.map} +0 -0
  113. /package/dist/{search-V3W5JMJG.js.map → search-4IYM525O.js.map} +0 -0
  114. /package/dist/{semantic-search-2DTOO5UX.js.map → semantic-search-G624D6CI.js.map} +0 -0
  115. /package/dist/{serve-DTQ3HENY.js.map → serve-QFUZWOU3.js.map} +0 -0
  116. /package/dist/{tool-executor-MJ7IG7PQ.js.map → telemetry-MVDNGJEC.js.map} +0 -0
  117. /package/dist/{tools-DZ4KETET.js.map → tool-executor-KEYQLO4M.js.map} +0 -0
  118. /package/dist/{types-EW7AIB3R.js.map → tools-EB3BHRRF.js.map} +0 -0
  119. /package/dist/{types-WGDLSPO6.js.map → types-NYKB2DN3.js.map} +0 -0
  120. /package/dist/{validator-7WXMDIHH.js.map → types-VRSXU4AM.js.map} +0 -0
  121. /package/dist/{web-server-DD7ZOP46.js.map → validator-LZXBFEPV.js.map} +0 -0
  122. /package/dist/{verification-gate-FYXUX6LH.js.map → verification-gate-ALSJVKSW.js.map} +0 -0
  123. /package/dist/{watcher-ISJC7YKL.js.map → watcher-CSHVDOCM.js.map} +0 -0
@@ -3,11 +3,11 @@
3
3
  import {
4
4
  loadConfig,
5
5
  writeDefaultConfig
6
- } from "./chunk-CHJ5GNZC.js";
7
- import "./chunk-4CWAGBNS.js";
6
+ } from "./chunk-EC42HQQH.js";
7
+ import "./chunk-4TQQZILG.js";
8
8
  import "./chunk-ZZJOFKAT.js";
9
9
  export {
10
10
  loadConfig,
11
11
  writeDefaultConfig
12
12
  };
13
- //# sourceMappingURL=config-WVMRUOCA.js.map
13
+ //# sourceMappingURL=config-2O6S2YJO.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ loadConfig,
3
+ writeDefaultConfig
4
+ } from "./chunk-XVFVTDE6.js";
5
+ import "./chunk-RPBC2QOA.js";
6
+ import "./chunk-DGUM43GV.js";
7
+ export {
8
+ loadConfig,
9
+ writeDefaultConfig
10
+ };
11
+ //# sourceMappingURL=config-LLQZYN2Q.js.map
@@ -2,12 +2,12 @@
2
2
 
3
3
  import {
4
4
  buildSystemPrompt
5
- } from "./chunk-UWQTZMNI.js";
6
- import "./chunk-UPLBF4RZ.js";
5
+ } from "./chunk-7GZ4D6V6.js";
6
+ import "./chunk-2UVWCTAY.js";
7
7
  import "./chunk-BSKDOFRT.js";
8
- import "./chunk-4CWAGBNS.js";
8
+ import "./chunk-4TQQZILG.js";
9
9
  import "./chunk-ZZJOFKAT.js";
10
10
  export {
11
11
  buildSystemPrompt
12
12
  };
13
- //# sourceMappingURL=context-loader-3ORBPMHJ.js.map
13
+ //# sourceMappingURL=context-loader-XCZ5EXNG.js.map
@@ -4,19 +4,19 @@ import {
4
4
  Conversation,
5
5
  parseJsonlContext,
6
6
  parseLegacyContext
7
- } from "./chunk-MPZ3BPUI.js";
8
- import "./chunk-UWQTZMNI.js";
7
+ } from "./chunk-UMXPOYZR.js";
8
+ import "./chunk-7GZ4D6V6.js";
9
9
  import "./chunk-DTTXPHFW.js";
10
10
  import "./chunk-Z2PUCXTZ.js";
11
- import "./chunk-UPLBF4RZ.js";
11
+ import "./chunk-2UVWCTAY.js";
12
12
  import "./chunk-BSKDOFRT.js";
13
13
  import "./chunk-IZ6UZ3ZL.js";
14
- import "./chunk-CHJ5GNZC.js";
15
- import "./chunk-4CWAGBNS.js";
14
+ import "./chunk-EC42HQQH.js";
15
+ import "./chunk-4TQQZILG.js";
16
16
  import "./chunk-ZZJOFKAT.js";
17
17
  export {
18
18
  Conversation,
19
19
  parseJsonlContext,
20
20
  parseLegacyContext
21
21
  };
22
- //# sourceMappingURL=conversation-QDEIDQPH.js.map
22
+ //# sourceMappingURL=conversation-OPLE23IM.js.map
@@ -7,16 +7,16 @@ import {
7
7
  findAgent,
8
8
  listAgents,
9
9
  loadAgentDocs
10
- } from "./chunk-YUFNYN2H.js";
11
- import "./chunk-DA7IKHC4.js";
10
+ } from "./chunk-PTQ37NRI.js";
11
+ import "./chunk-NOJW5KG2.js";
12
12
  import "./chunk-DTTXPHFW.js";
13
13
  import "./chunk-Z2PUCXTZ.js";
14
- import "./chunk-XTBKL5BI.js";
15
- import "./chunk-UPLBF4RZ.js";
14
+ import "./chunk-2ENYRENZ.js";
15
+ import "./chunk-2UVWCTAY.js";
16
16
  import "./chunk-BSKDOFRT.js";
17
17
  import "./chunk-IZ6UZ3ZL.js";
18
- import "./chunk-CHJ5GNZC.js";
19
- import "./chunk-4CWAGBNS.js";
18
+ import "./chunk-EC42HQQH.js";
19
+ import "./chunk-4TQQZILG.js";
20
20
  import "./chunk-ZZJOFKAT.js";
21
21
  export {
22
22
  buildAgentPrompt,
@@ -26,4 +26,4 @@ export {
26
26
  listAgents,
27
27
  loadAgentDocs
28
28
  };
29
- //# sourceMappingURL=delegate-VJCJLYEK.js.map
29
+ //# sourceMappingURL=delegate-ZJCIADNN.js.map
@@ -2,10 +2,10 @@
2
2
 
3
3
  import {
4
4
  loadConfig
5
- } from "./chunk-CHJ5GNZC.js";
5
+ } from "./chunk-EC42HQQH.js";
6
6
  import {
7
7
  getPrimitiveDirs
8
- } from "./chunk-4CWAGBNS.js";
8
+ } from "./chunk-4TQQZILG.js";
9
9
  import "./chunk-ZZJOFKAT.js";
10
10
 
11
11
  // src/runtime/export.ts
@@ -162,4 +162,4 @@ export {
162
162
  readBundle,
163
163
  writeBundle
164
164
  };
165
- //# sourceMappingURL=export-6GCYHEHQ.js.map
165
+ //# sourceMappingURL=export-2HEAAOUF.js.map
@@ -3,12 +3,12 @@
3
3
  import {
4
4
  buildDependencyGraph,
5
5
  getGraphStats
6
- } from "./chunk-274RV3YO.js";
7
- import "./chunk-UPLBF4RZ.js";
8
- import "./chunk-4CWAGBNS.js";
6
+ } from "./chunk-GX2RCSFJ.js";
7
+ import "./chunk-2UVWCTAY.js";
8
+ import "./chunk-4TQQZILG.js";
9
9
  import "./chunk-ZZJOFKAT.js";
10
10
  export {
11
11
  buildDependencyGraph,
12
12
  getGraphStats
13
13
  };
14
- //# sourceMappingURL=graph-YUIPOSOO.js.map
14
+ //# sourceMappingURL=graph-5MKRTC3J.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ createHarness
3
+ } from "./chunk-MSO7DKBK.js";
4
+ import "./chunk-XVFVTDE6.js";
5
+ import "./chunk-RPBC2QOA.js";
6
+ import "./chunk-FD55B3IO.js";
7
+ import "./chunk-DGUM43GV.js";
8
+ export {
9
+ createHarness
10
+ };
11
+ //# sourceMappingURL=harness-ABKZWP47.js.map
@@ -2,25 +2,25 @@
2
2
 
3
3
  import {
4
4
  createHarness
5
- } from "./chunk-YIJY5DBV.js";
5
+ } from "./chunk-P74KXHA4.js";
6
6
  import "./chunk-AGAAFJEO.js";
7
7
  import "./chunk-5H34JPMB.js";
8
- import "./chunk-DA7IKHC4.js";
9
- import "./chunk-UWQTZMNI.js";
8
+ import "./chunk-NOJW5KG2.js";
9
+ import "./chunk-7GZ4D6V6.js";
10
10
  import "./chunk-UDZIS2AQ.js";
11
11
  import "./chunk-DTTXPHFW.js";
12
12
  import "./chunk-Z2PUCXTZ.js";
13
13
  import "./chunk-TAT6JU3X.js";
14
14
  import "./chunk-JKMGYWXB.js";
15
15
  import "./chunk-OC6YSTDX.js";
16
- import "./chunk-XTBKL5BI.js";
17
- import "./chunk-UPLBF4RZ.js";
16
+ import "./chunk-2ENYRENZ.js";
17
+ import "./chunk-2UVWCTAY.js";
18
18
  import "./chunk-BSKDOFRT.js";
19
19
  import "./chunk-IZ6UZ3ZL.js";
20
- import "./chunk-CHJ5GNZC.js";
21
- import "./chunk-4CWAGBNS.js";
20
+ import "./chunk-EC42HQQH.js";
21
+ import "./chunk-4TQQZILG.js";
22
22
  import "./chunk-ZZJOFKAT.js";
23
23
  export {
24
24
  createHarness
25
25
  };
26
- //# sourceMappingURL=harness-WE4SLCML.js.map
26
+ //# sourceMappingURL=harness-XSBQBY7T.js.map
package/dist/index.d.ts CHANGED
@@ -121,6 +121,21 @@ declare const HarnessConfigSchema: z.ZodObject<{
121
121
  name: z.ZodOptional<z.ZodString>;
122
122
  token: z.ZodOptional<z.ZodString>;
123
123
  }, z.core.$loose>>>;
124
+ install: z.ZodDefault<z.ZodObject<{
125
+ allowed_licenses: z.ZodDefault<z.ZodArray<z.ZodString>>;
126
+ on_unknown_license: z.ZodDefault<z.ZodEnum<{
127
+ allow: "allow";
128
+ warn: "warn";
129
+ prompt: "prompt";
130
+ block: "block";
131
+ }>>;
132
+ on_proprietary: z.ZodDefault<z.ZodEnum<{
133
+ allow: "allow";
134
+ warn: "warn";
135
+ prompt: "prompt";
136
+ block: "block";
137
+ }>>;
138
+ }, z.core.$loose>>;
124
139
  }, z.core.$loose>;
125
140
  type HarnessConfig = z.infer<typeof HarnessConfigSchema>;
126
141
  declare const CORE_PRIMITIVE_DIRS: readonly ["rules", "instincts", "skills", "playbooks", "workflows", "tools", "agents"];
@@ -3413,6 +3428,13 @@ interface UniversalInstallOptions {
3413
3428
  skipFix?: boolean;
3414
3429
  /** Additional tags to add */
3415
3430
  tags?: string[];
3431
+ /**
3432
+ * Override the license policy for THIS install only. Pass an SPDX id like
3433
+ * "MIT" or "Apache-2.0" — the installer will treat the file as if its
3434
+ * license were the override and skip the policy check entirely. Use only
3435
+ * when you have written permission for the content. (Level 3 of 12.14.)
3436
+ */
3437
+ forceLicense?: string;
3416
3438
  }
3417
3439
  /**
3418
3440
  * Detect the format of a file based on its content and extension.
package/dist/index.js CHANGED
@@ -37,7 +37,6 @@ import {
37
37
  listToolSummaries,
38
38
  loadAllPrimitives,
39
39
  loadAllPrimitivesWithErrors,
40
- loadConfig,
41
40
  loadCosts,
42
41
  loadDirectory,
43
42
  loadDirectoryWithErrors,
@@ -67,15 +66,18 @@ import {
67
66
  validateMcpConfig,
68
67
  withFileLock,
69
68
  withFileLockSync,
70
- writeDefaultConfig,
71
69
  writeSession
72
- } from "./chunk-GUJTBGVS.js";
70
+ } from "./chunk-MSO7DKBK.js";
71
+ import {
72
+ loadConfig,
73
+ writeDefaultConfig
74
+ } from "./chunk-XVFVTDE6.js";
73
75
  import {
74
76
  CORE_PRIMITIVE_DIRS,
75
77
  FrontmatterSchema,
76
78
  HarnessConfigSchema,
77
79
  getPrimitiveDirs
78
- } from "./chunk-KFX54TQM.js";
80
+ } from "./chunk-RPBC2QOA.js";
79
81
  import {
80
82
  generate,
81
83
  generateWithMessages,
@@ -366,7 +368,7 @@ function generateSystemMd(harnessDir, agentName) {
366
368
  async function generateCoreMd(agentName, purpose, options) {
367
369
  try {
368
370
  const { generate: generate2, getModel: getModel2 } = await import("./provider-LQHQX7Z7.js");
369
- const { HarnessConfigSchema: HarnessConfigSchema2 } = await import("./types-WGDLSPO6.js");
371
+ const { HarnessConfigSchema: HarnessConfigSchema2 } = await import("./types-VRSXU4AM.js");
370
372
  const config = HarnessConfigSchema2.parse({
371
373
  agent: { name: agentName, version: "0.1.0" },
372
374
  model: {
@@ -11849,7 +11851,7 @@ function startServe(options) {
11849
11851
  return c.json({ error: "prompt is required" }, 400);
11850
11852
  }
11851
11853
  try {
11852
- const { createHarness: createHarness2 } = await import("./harness-LCHA3DWP.js");
11854
+ const { createHarness: createHarness2 } = await import("./harness-ABKZWP47.js");
11853
11855
  const harness = createHarness2({
11854
11856
  dir: harnessDir,
11855
11857
  model: body.model,
@@ -12496,6 +12498,130 @@ async function resolveGithubCommitSha(url) {
12496
12498
  clearTimeout(timeout);
12497
12499
  }
12498
12500
  }
12501
+ var SIBLING_LICENSE_NAMES = [
12502
+ "LICENSE",
12503
+ "LICENSE.txt",
12504
+ "LICENSE.md",
12505
+ "COPYING",
12506
+ "COPYING.txt"
12507
+ ];
12508
+ function classifyLicenseText(text) {
12509
+ const lower = text.toLowerCase();
12510
+ if (lower.includes("all rights reserved")) {
12511
+ return "PROPRIETARY";
12512
+ }
12513
+ if (lower.includes("mit license")) return "MIT";
12514
+ if (lower.includes("apache license, version 2.0") || lower.includes("apache-2.0"))
12515
+ return "Apache-2.0";
12516
+ if (lower.includes("mozilla public license version 2.0") || lower.includes("mpl-2.0"))
12517
+ return "MPL-2.0";
12518
+ if (lower.includes("gnu affero general public license")) return "AGPL-3.0";
12519
+ if (lower.includes("gnu lesser general public license")) {
12520
+ if (lower.includes("version 3")) return "LGPL-3.0";
12521
+ if (lower.includes("version 2")) return "LGPL-2.1";
12522
+ }
12523
+ if (lower.includes("gnu general public license")) {
12524
+ if (lower.includes("version 3")) return "GPL-3.0";
12525
+ if (lower.includes("version 2")) return "GPL-2.0";
12526
+ }
12527
+ if (lower.includes("isc license")) return "ISC";
12528
+ if (lower.includes("cc0 1.0 universal") || lower.includes("cc0-1.0")) return "CC0-1.0";
12529
+ if (lower.includes("creative commons attribution-sharealike 4.0")) return "CC-BY-SA-4.0";
12530
+ if (lower.includes("creative commons attribution 4.0") || lower.includes("cc-by-4.0"))
12531
+ return "CC-BY-4.0";
12532
+ if (lower.includes("redistribution and use in source and binary forms") && lower.includes("neither the name of")) {
12533
+ return "BSD-3-Clause";
12534
+ }
12535
+ if (lower.includes("redistribution and use in source and binary forms")) {
12536
+ return "BSD-2-Clause";
12537
+ }
12538
+ if (lower.includes("this is free and unencumbered software released into the public domain")) {
12539
+ return "Unlicense";
12540
+ }
12541
+ return "UNKNOWN";
12542
+ }
12543
+ function extractCopyright(text) {
12544
+ const lines = text.split(/\r?\n/);
12545
+ for (const line of lines) {
12546
+ const trimmed = line.trim();
12547
+ if (/^©\s*\d{4}/.test(trimmed) || /^copyright\b.*\d{4}/i.test(trimmed)) {
12548
+ return trimmed;
12549
+ }
12550
+ }
12551
+ return void 0;
12552
+ }
12553
+ async function fetchSiblingLicense(siblingUrl) {
12554
+ const controller = new AbortController();
12555
+ const timeout = setTimeout(() => controller.abort(), 5e3);
12556
+ try {
12557
+ const response = await fetch(siblingUrl, { signal: controller.signal });
12558
+ if (!response.ok) return null;
12559
+ return await response.text();
12560
+ } catch {
12561
+ return null;
12562
+ } finally {
12563
+ clearTimeout(timeout);
12564
+ }
12565
+ }
12566
+ async function fetchGithubRepoLicense(owner, repo) {
12567
+ const apiUrl = `https://api.github.com/repos/${owner}/${repo}/license`;
12568
+ const controller = new AbortController();
12569
+ const timeout = setTimeout(() => controller.abort(), 5e3);
12570
+ try {
12571
+ const response = await fetch(apiUrl, {
12572
+ signal: controller.signal,
12573
+ headers: { "Accept": "application/vnd.github+json" }
12574
+ });
12575
+ if (!response.ok) return null;
12576
+ const data = await response.json();
12577
+ const spdxId = data.license?.spdx_id;
12578
+ if (!spdxId || spdxId === "NOASSERTION") return null;
12579
+ let body;
12580
+ if (data.content && data.encoding === "base64") {
12581
+ try {
12582
+ body = Buffer.from(data.content, "base64").toString("utf-8");
12583
+ } catch {
12584
+ body = void 0;
12585
+ }
12586
+ }
12587
+ return { spdxId, htmlUrl: data.html_url ?? "", body };
12588
+ } catch {
12589
+ return null;
12590
+ } finally {
12591
+ clearTimeout(timeout);
12592
+ }
12593
+ }
12594
+ async function detectLicense(sourceUrl) {
12595
+ const match2 = sourceUrl.match(
12596
+ /^https?:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)\/(.+)$/
12597
+ );
12598
+ if (!match2) {
12599
+ return { spdxId: "UNKNOWN" };
12600
+ }
12601
+ const [, owner, repo, ref, path] = match2;
12602
+ const lastSlash = path.lastIndexOf("/");
12603
+ const dir = lastSlash >= 0 ? path.slice(0, lastSlash) : "";
12604
+ const dirPrefix = dir ? `${dir}/` : "";
12605
+ for (const siblingName of SIBLING_LICENSE_NAMES) {
12606
+ const siblingUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${dirPrefix}${siblingName}`;
12607
+ const text = await fetchSiblingLicense(siblingUrl);
12608
+ if (text) {
12609
+ const spdxId = classifyLicenseText(text);
12610
+ const copyright = extractCopyright(text);
12611
+ return { spdxId, copyright, licenseSource: siblingUrl };
12612
+ }
12613
+ }
12614
+ const repoLicense = await fetchGithubRepoLicense(owner, repo);
12615
+ if (repoLicense) {
12616
+ const copyright = repoLicense.body ? extractCopyright(repoLicense.body) : void 0;
12617
+ return {
12618
+ spdxId: repoLicense.spdxId,
12619
+ copyright,
12620
+ licenseSource: repoLicense.htmlUrl || void 0
12621
+ };
12622
+ }
12623
+ return { spdxId: "UNKNOWN" };
12624
+ }
12499
12625
  async function recordProvenance(content, originalSource) {
12500
12626
  let parsed;
12501
12627
  try {
@@ -12513,10 +12639,51 @@ async function recordProvenance(content, originalSource) {
12513
12639
  data.source_commit = sha;
12514
12640
  }
12515
12641
  }
12642
+ if (!data.license || !data.copyright || !data.license_source) {
12643
+ const license = await detectLicense(originalSource);
12644
+ if (!data.license) {
12645
+ data.license = license.spdxId;
12646
+ }
12647
+ if (!data.copyright && license.copyright) {
12648
+ data.copyright = license.copyright;
12649
+ }
12650
+ if (!data.license_source && license.licenseSource) {
12651
+ data.license_source = license.licenseSource;
12652
+ }
12653
+ }
12516
12654
  data.installed_at = (/* @__PURE__ */ new Date()).toISOString();
12517
12655
  data.installed_by = `agent-harness@${getHarnessVersion()}`;
12518
12656
  return matter4.stringify(parsed.content, data);
12519
12657
  }
12658
+ function evaluateLicensePolicy(detected, policy, forceLicense) {
12659
+ if (forceLicense) {
12660
+ return {
12661
+ action: "allow",
12662
+ reason: `forced license override: ${forceLicense}`,
12663
+ spdxId: forceLicense
12664
+ };
12665
+ }
12666
+ const spdxId = detected.spdxId;
12667
+ if (spdxId === "PROPRIETARY") {
12668
+ return {
12669
+ action: policy.on_proprietary,
12670
+ reason: detected.licenseSource ? `proprietary content per ${detected.licenseSource}` : 'proprietary content (license text says "all rights reserved")',
12671
+ spdxId
12672
+ };
12673
+ }
12674
+ if (policy.allowed_licenses.includes(spdxId)) {
12675
+ return {
12676
+ action: "allow",
12677
+ reason: `${spdxId} is in allowed_licenses`,
12678
+ spdxId
12679
+ };
12680
+ }
12681
+ return {
12682
+ action: policy.on_unknown_license,
12683
+ reason: spdxId === "UNKNOWN" ? "no LICENSE file found in source repo (per-file, repo root, or frontmatter)" : `${spdxId} is not in your allowed_licenses (config.yaml install.allowed_licenses)`,
12684
+ spdxId
12685
+ };
12686
+ }
12520
12687
  var VALID_TYPES2 = ["rule", "instinct", "skill", "playbook", "workflow", "tool", "agent"];
12521
12688
  var TYPE_DIRS2 = {
12522
12689
  rule: "rules",
@@ -12927,6 +13094,59 @@ async function universalInstall(harnessDir, source, options) {
12927
13094
  if (source.startsWith("http://") || source.startsWith("https://")) {
12928
13095
  finalContent = await recordProvenance(finalContent, source);
12929
13096
  result.fixes.push("Recorded provenance (source, installed_at, installed_by)");
13097
+ try {
13098
+ const { loadConfig: loadConfig2 } = await import("./config-LLQZYN2Q.js");
13099
+ const config = loadConfig2(harnessDir);
13100
+ const installPolicy = config.install;
13101
+ const parsed = matter4(finalContent);
13102
+ const detected = {
13103
+ spdxId: typeof parsed.data.license === "string" ? parsed.data.license : "UNKNOWN",
13104
+ copyright: typeof parsed.data.copyright === "string" ? parsed.data.copyright : void 0,
13105
+ licenseSource: typeof parsed.data.license_source === "string" ? parsed.data.license_source : void 0
13106
+ };
13107
+ const decision = evaluateLicensePolicy(detected, installPolicy, options?.forceLicense);
13108
+ if (decision.action === "block") {
13109
+ result.errors.push(
13110
+ `License policy blocked install: ${decision.reason}` + (detected.licenseSource ? ` (${detected.licenseSource})` : "") + `. To override, re-run with --force-license <SPDX> if you have written permission.`
13111
+ );
13112
+ return result;
13113
+ }
13114
+ if (decision.action === "warn") {
13115
+ log.warn(
13116
+ `[install] license policy warning: ${decision.reason}. Installing anyway (set install.on_unknown_license: block in config.yaml to refuse).`
13117
+ );
13118
+ result.fixes.push(`License policy: warned (${decision.spdxId})`);
13119
+ }
13120
+ if (decision.action === "prompt") {
13121
+ if (process.stdin.isTTY && process.stdout.isTTY) {
13122
+ const readline = await import("readline");
13123
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
13124
+ const question = `
13125
+ \u26A0 License policy: ${decision.reason}
13126
+ ${detected.licenseSource ? `License source: ${detected.licenseSource}
13127
+ ` : ""}Install anyway? [y/N] `;
13128
+ const answer = await new Promise((res) => rl.question(question, res));
13129
+ rl.close();
13130
+ if (!/^y(es)?$/i.test(answer.trim())) {
13131
+ result.errors.push("License policy prompt declined by user");
13132
+ return result;
13133
+ }
13134
+ result.fixes.push(`License policy: prompted, user accepted (${decision.spdxId})`);
13135
+ } else {
13136
+ result.errors.push(
13137
+ `License policy requires interactive confirmation (${decision.reason}) but stdin/stdout is not a TTY. Re-run interactively, or pass --force-license <SPDX> if you have written permission.`
13138
+ );
13139
+ return result;
13140
+ }
13141
+ }
13142
+ if (decision.action === "allow" && options?.forceLicense) {
13143
+ result.fixes.push(`License policy: forced to ${decision.spdxId}`);
13144
+ }
13145
+ } catch (err) {
13146
+ log.warn(
13147
+ `[install] license policy check skipped: ${err instanceof Error ? err.message : String(err)}`
13148
+ );
13149
+ }
12930
13150
  }
12931
13151
  const tempDir = join32(tmpdir2(), "harness-install");
12932
13152
  mkdirSync16(tempDir, { recursive: true });