@gencode/agents 0.1.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @gencode/agents
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add CLI support for loading additional absolute skill directories and pass them through run and resume flows into the agent skill registry.
8
+
9
+ ### Patch Changes
10
+
11
+ - 059d077: Expose completed subagent results in status polling and delay delivery marking until parent announce handling succeeds.
12
+
13
+ ## 0.1.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 2908094: Preserve skill-loading correctness across context compaction by requiring explicit reloads when SKILL.md content is no longer visible.
18
+
3
19
  ## 0.1.0
4
20
 
5
21
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -162,7 +162,12 @@ type AgentRunParamsBase = {
162
162
  ownershipUid?: number | null; /** Optional tool allowlist for plugin tools */
163
163
  toolAllowlist?: string[]; /** Optional allowlist for plugin LLM access (plugin id or tool name) */
164
164
  llmAllowlist?: string[];
165
- }; /** Memory system options (optional) */
165
+ };
166
+ /**
167
+ * Additional skill registry directories supplied by the CLI.
168
+ * Each directory contains skill child directories such as <dir>/<skill-name>/SKILL.md.
169
+ */
170
+ skillsLoadPaths?: string[]; /** Memory system options (optional) */
166
171
  memory?: {
167
172
  /** Explicit memory provider id (overrides plugins.slots.memory) */providerId?: string; /** Explicit plugin id for memory provider (used when providerId not set) */
168
173
  pluginId?: string; /** Whether memory replies should include source path/line hints */
@@ -278,7 +283,7 @@ declare const MAX_CHILDREN_PER_SESSION = 5;
278
283
  */
279
284
  declare class SubagentRegistry {
280
285
  private readonly entries;
281
- /** RunIds that have already been returned by consumeCompleted */
286
+ /** RunIds whose terminal result has already been delivered to the parent. */
282
287
  private readonly announced;
283
288
  register(record: SubagentRunRecord, promise: Promise<void>): void;
284
289
  complete(runId: string, result: string): void;
@@ -298,13 +303,21 @@ declare class SubagentRegistry {
298
303
  * Returns immediately if nothing is pending.
299
304
  */
300
305
  waitForAll(parentSessionId: string): Promise<void>;
306
+ /**
307
+ * Returns all finished runs whose terminal result has not yet been delivered.
308
+ * This is a read-only snapshot; callers must explicitly mark delivery after
309
+ * the result has been handed back to the parent.
310
+ */
311
+ peekCompleted(parentSessionId: string): SubagentRunRecord[];
301
312
  /**
302
313
  * Returns all finished runs that have not yet been returned by this method,
303
314
  * and marks them as announced so they are not returned again.
304
315
  */
305
316
  consumeCompleted(parentSessionId: string): SubagentRunRecord[];
306
317
  /** Marks a finished run as already delivered to its parent. */
307
- markAnnounced(runId: string): void;
318
+ markAnnounced(runId: string | string[]): void;
319
+ /** Returns whether a run's terminal result has already been delivered. */
320
+ isAnnounced(runId: string): boolean;
308
321
  /** Returns true if there are completed runs not yet returned by consumeCompleted. */
309
322
  hasUnannounced(parentSessionId: string): boolean;
310
323
  /**
@@ -1117,7 +1130,7 @@ type SkillViewResult = {
1117
1130
  * Returns at most MAX_SKILLS_IN_PROMPT skills.
1118
1131
  */
1119
1132
  declare function loadSkills(dataDir: string): Promise<Skill[]>;
1120
- declare function loadSkillsWithPluginDirs(dataDir: string, pluginDirs: string[]): Promise<Skill[]>;
1133
+ declare function loadSkillsWithPluginDirs(dataDir: string, pluginDirs: string[], skillsLoadPaths?: string[]): Promise<Skill[]>;
1121
1134
  declare function loadSkillsFromDirs(dirs: string[]): Promise<Skill[]>;
1122
1135
  declare function findSkillByName(dirs: string[], requestedName: string): Promise<SkillDirectory | undefined>;
1123
1136
  declare function loadSkillView(dirs: string[], requestedName: string, skillPath?: string): Promise<SkillViewResult | undefined>;
@@ -1608,10 +1621,11 @@ type SkillLoadToolResult = {
1608
1621
  type SkillUsedReporter = (event: Extract<AgentProgressEvent$2, {
1609
1622
  type: "skill_used";
1610
1623
  }>) => Promise<void>;
1611
- declare function createSkillListTool(dataDir: string, pluginDirs: string[]): AgentTool<typeof skillListSchema, SkillListResult>;
1624
+ declare function createSkillListTool(dataDir: string, pluginDirs: string[], skillsLoadPaths?: string[]): AgentTool<typeof skillListSchema, SkillListResult>;
1612
1625
  declare function createSkillLoadTool(params: {
1613
1626
  dataDir: string;
1614
1627
  pluginDirs: string[];
1628
+ skillsLoadPaths?: string[];
1615
1629
  sessionId: string;
1616
1630
  reportSkillUsed?: SkillUsedReporter;
1617
1631
  }): AgentTool<typeof skillLoadSchema, SkillLoadToolResult>;
@@ -1673,11 +1687,12 @@ declare function buildSubagentAnnounceMessage(params: {
1673
1687
  * @param loopDetection Tool-loop detection config inherited from the parent.
1674
1688
  * @param spawnFn Function that actually runs a child agent (injected to avoid circular imports).
1675
1689
  */
1676
- declare function createSubagentSpawnTool(registry: SubagentRegistry, parentSessionId: string, depth: number, dataDir: string, channel: AgentRunParams["channel"], llm: AgentRunParams["llm"], loopDetection: ToolLoopDetectionConfig | undefined, inheritedRunParams: Pick<AgentRunParams, "plugins" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName">, spawnFn: (params: AgentRunParams) => Promise<AgentRunResult>): AgentTool<typeof spawnSchema, SpawnResult>;
1690
+ declare function createSubagentSpawnTool(registry: SubagentRegistry, parentSessionId: string, depth: number, dataDir: string, channel: AgentRunParams["channel"], llm: AgentRunParams["llm"], loopDetection: ToolLoopDetectionConfig | undefined, inheritedRunParams: Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName">, spawnFn: (params: AgentRunParams) => Promise<AgentRunResult>): AgentTool<typeof spawnSchema, SpawnResult>;
1677
1691
  //#endregion
1678
1692
  //#region src/tools/subagents.d.ts
1679
1693
  declare const ACTIONS: readonly ["list", "kill"];
1680
1694
  type SubagentsAction = (typeof ACTIONS)[number];
1695
+ type SubagentDeliveryStatus = "running" | "pending" | "delivered";
1681
1696
  declare const subagentsSchema: TObject<{
1682
1697
  action: TUnion<[TLiteral<"list">, TLiteral<"kill">]>;
1683
1698
  target: TOptional<TString>;
@@ -1690,8 +1705,11 @@ type SubagentsResult = {
1690
1705
  label: string;
1691
1706
  task: string;
1692
1707
  status: string;
1708
+ deliveryStatus: SubagentDeliveryStatus;
1693
1709
  depth: number;
1694
1710
  runtimeMs: number;
1711
+ result?: string;
1712
+ error?: string;
1695
1713
  }>;
1696
1714
  killed?: number;
1697
1715
  error?: string;
@@ -1781,10 +1799,11 @@ type SubagentToolsContext = {
1781
1799
  depth: number;
1782
1800
  channel: AgentRunParams["channel"];
1783
1801
  llm: AgentRunParams["llm"];
1784
- inheritedRunParams?: Pick<AgentRunParams, "plugins" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName">;
1802
+ inheritedRunParams?: Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName">;
1785
1803
  loopDetection?: ToolLoopDetectionConfig;
1786
1804
  memoryOptions?: MemoryToolOptions;
1787
1805
  pluginSkillDirs?: string[];
1806
+ skillsLoadPaths?: string[];
1788
1807
  reportSkillUsed?: (event: Extract<AgentProgressEvent$2, {
1789
1808
  type: "skill_used";
1790
1809
  }>) => Promise<void>;