@ai-agent-forge/plugin-git-repository 0.85.5 → 0.85.7

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/agent-forge.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packageFormatVersion": 1,
3
3
  "id": "agent-forge.plugin.git-repository",
4
- "pluginVersion": "0.85.5",
4
+ "pluginVersion": "0.85.7",
5
5
  "apiVersion": "1",
6
6
  "minHostVersion": "0.84.4",
7
7
  "capabilityRefs": [
@@ -1 +1 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,OAAO,KAAK,EAAE,sBAAsB,EAAyB,MAAM,YAAY,CAAC;AAqFhF,sFAAsF;AACtF,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,sBAAsB,GAAG,2BAA2B,CA0CnH","sourcesContent":["import type { CapabilityPluginSyncFactory } from \"@agent-forge/plugin-sdk\";\nimport { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n\tGIT_REPOSITORY_MAX_ENTRIES_V1,\n\tGIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\tGIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1,\n\tprojectGitRepositoryResultV1,\n} from \"./node-adapter.ts\";\nimport type { GitRepositoryAdapterV1, GitRepositoryResultV1 } from \"./types.ts\";\n\nconst requestSchema = Type.Object(\n\t{\n\t\tworkspaceRef: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: GIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\t\t\tpattern: \"^[A-Za-z0-9][A-Za-z0-9._:-]*$\",\n\t\t}),\n\t\toperation: Type.Union([Type.Literal(\"status\"), Type.Literal(\"diff-summary\"), Type.Literal(\"log-summary\")]),\n\t\tlimit: Type.Optional(Type.Integer({ minimum: 1, maximum: GIT_REPOSITORY_MAX_ENTRIES_V1 })),\n\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 120_000 })),\n\t},\n\t{ additionalProperties: false },\n);\nconst inputSchema = Type.Object({ request: requestSchema }, { additionalProperties: false });\n\nfunction emptySummary(): GitRepositoryResultV1[\"summary\"] {\n\treturn {\n\t\tfilesChanged: 0,\n\t\tadded: 0,\n\t\tmodified: 0,\n\t\tdeleted: 0,\n\t\tuntracked: 0,\n\t\tconflicted: 0,\n\t\tadditions: 0,\n\t\tdeletions: 0,\n\t\tcommits: 0,\n\t};\n}\n\nfunction fallback(operationId: string, status: \"failed\" | \"cancelled\"): GitRepositoryResultV1 {\n\treturn {\n\t\tversion: 1,\n\t\toperationId,\n\t\tstatus,\n\t\tsummary: emptySummary(),\n\t\tentries: [],\n\t\tentriesTruncated: false,\n\t\terror: {\n\t\t\tversion: 1,\n\t\t\tcode: status === \"cancelled\" ? \"cancelled\" : \"adapter_failed\",\n\t\t\tmessage: status === \"cancelled\" ? \"Git repository read was cancelled\" : \"Git repository adapter failed\",\n\t\t},\n\t};\n}\n\nfunction objectInput(first: unknown, second: unknown): Record<string, unknown> {\n\tconst value = second === undefined ? first : second;\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value))\n\t\tthrow new Error(\"Git repository input must be an object\");\n\treturn value as Record<string, unknown>;\n}\n\nfunction invocation(\n\tfirst: unknown,\n\tsecond: unknown,\n): { readonly input: Record<string, unknown>; readonly operationId: string } {\n\tconst candidate = typeof first === \"string\" && first.trim() !== \"\" ? first : \"profile-runtime-tool-call\";\n\treturn {\n\t\tinput: objectInput(first, second),\n\t\toperationId:\n\t\t\tcandidate.length <= GIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1 ? candidate : \"profile-runtime-tool-call\",\n\t};\n}\n\nfunction signalFrom(value: unknown): AbortSignal | undefined {\n\treturn value instanceof AbortSignal ? value : undefined;\n}\n\nconst CANCELLATION_V1 = Symbol(\"git-repository-capability-cancelled\");\n\nfunction runWithCancellation(\n\trun: () => Promise<GitRepositoryResultV1>,\n\tsignal: AbortSignal | undefined,\n): Promise<GitRepositoryResultV1 | typeof CANCELLATION_V1> {\n\tif (signal === undefined) return run();\n\tlet onAbort!: () => void;\n\tconst cancellation = new Promise<typeof CANCELLATION_V1>((resolve) => {\n\t\tonAbort = () => resolve(CANCELLATION_V1);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\treturn Promise.race([run(), cancellation]).finally(() => signal.removeEventListener(\"abort\", onAbort));\n}\n\n/** Registers a single read-only repository inspection tool with opaque input only. */\nexport function createGitRepositoryCapabilityFactoryV1(runtime: GitRepositoryAdapterV1): CapabilityPluginSyncFactory {\n\treturn (api) => {\n\t\tapi.registerTool({\n\t\t\tname: \"git_repository_inspect\",\n\t\t\tlabel: \"Inspect repository\",\n\t\t\tdescription: \"Read bounded git status, diff summary, or log summary through a host-owned workspace reference\",\n\t\t\tparameters: inputSchema,\n\t\t\texecute: async (first: unknown, second?: unknown, third?: unknown) => {\n\t\t\t\tlet call: { readonly input: Record<string, unknown>; readonly operationId: string };\n\t\t\t\ttry {\n\t\t\t\t\tcall = invocation(first, second);\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(\"profile-runtime-tool-call\", \"failed\");\n\t\t\t\t}\n\t\t\t\tconst signal = signalFrom(third);\n\t\t\t\tif (signal?.aborted) return fallback(call.operationId, \"cancelled\");\n\t\t\t\tif (!Value.Check(inputSchema, call.input)) return fallback(call.operationId, \"failed\");\n\t\t\t\tconst request = call.input.request as Record<string, unknown>;\n\t\t\t\ttry {\n\t\t\t\t\tconst output = await runWithCancellation(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\truntime.run(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\t\t\toperationId: call.operationId,\n\t\t\t\t\t\t\t\t\tworkspaceRef: request.workspaceRef as string,\n\t\t\t\t\t\t\t\t\toperation: request.operation as \"status\" | \"diff-summary\" | \"log-summary\",\n\t\t\t\t\t\t\t\t\t...(request.limit === undefined ? {} : { limit: request.limit as number }),\n\t\t\t\t\t\t\t\t\t...(request.timeoutMs === undefined ? {} : { timeoutMs: request.timeoutMs as number }),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t);\n\t\t\t\t\tif (output === CANCELLATION_V1) return fallback(call.operationId, \"cancelled\");\n\t\t\t\t\treturn projectGitRepositoryResultV1(output, call.operationId) ?? fallback(call.operationId, \"failed\");\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(call.operationId, \"failed\");\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t};\n}\n"]}
1
+ {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAS3E,OAAO,KAAK,EAAE,sBAAsB,EAAyB,MAAM,YAAY,CAAC;AAyFhF,sFAAsF;AACtF,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,sBAAsB,GAAG,2BAA2B,CA0CnH","sourcesContent":["import type { CapabilityPluginSyncFactory } from \"@agent-forge/plugin-sdk\";\nimport { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n\tGIT_REPOSITORY_MAX_ENTRIES_V1,\n\tGIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\tGIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1,\n\tprojectGitRepositoryResultV1,\n} from \"./node-adapter.ts\";\nimport type { GitRepositoryAdapterV1, GitRepositoryResultV1 } from \"./types.ts\";\n\nconst requestSchema = Type.Object(\n\t{\n\t\tworkspaceRef: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: GIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\t\t\tpattern: \"^[A-Za-z0-9][A-Za-z0-9._:-]*$\",\n\t\t}),\n\t\toperation: Type.Union([Type.Literal(\"status\"), Type.Literal(\"diff-summary\"), Type.Literal(\"log-summary\")]),\n\t\tlimit: Type.Optional(Type.Integer({ minimum: 1, maximum: GIT_REPOSITORY_MAX_ENTRIES_V1 })),\n\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 120_000 })),\n\t},\n\t{ additionalProperties: false },\n);\nconst inputSchema = Type.Object({ request: requestSchema }, { additionalProperties: false });\n\nfunction emptySummary(): GitRepositoryResultV1[\"summary\"] {\n\treturn {\n\t\tfilesChanged: 0,\n\t\tadded: 0,\n\t\tmodified: 0,\n\t\tdeleted: 0,\n\t\tuntracked: 0,\n\t\tconflicted: 0,\n\t\tadditions: 0,\n\t\tdeletions: 0,\n\t\tcommits: 0,\n\t};\n}\n\nfunction fallback(operationId: string, status: \"failed\" | \"cancelled\"): GitRepositoryResultV1 {\n\treturn {\n\t\tversion: 1,\n\t\toperationId,\n\t\tstatus,\n\t\tsummary: emptySummary(),\n\t\tentries: [],\n\t\tentriesTruncated: false,\n\t\terror: {\n\t\t\tversion: 1,\n\t\t\tcode: status === \"cancelled\" ? \"cancelled\" : \"adapter_failed\",\n\t\t\tmessage: status === \"cancelled\" ? \"Git repository read was cancelled\" : \"Git repository adapter failed\",\n\t\t},\n\t};\n}\n\nfunction objectInput(first: unknown, second: unknown): Record<string, unknown> {\n\t// Shape-based dual-convention read (aligned with subagent-delegate): the\n\t// runtime invoke face passes the input object first and the host\n\t// CapabilityToolContext second; the agent tool face passes the tool call\n\t// id (a string) first and the params object second.\n\tconst value = first !== null && typeof first === \"object\" && !Array.isArray(first) ? first : second;\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value))\n\t\tthrow new Error(\"Git repository input must be an object\");\n\treturn value as Record<string, unknown>;\n}\n\nfunction invocation(\n\tfirst: unknown,\n\tsecond: unknown,\n): { readonly input: Record<string, unknown>; readonly operationId: string } {\n\tconst candidate = typeof first === \"string\" && first.trim() !== \"\" ? first : \"profile-runtime-tool-call\";\n\treturn {\n\t\tinput: objectInput(first, second),\n\t\toperationId:\n\t\t\tcandidate.length <= GIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1 ? candidate : \"profile-runtime-tool-call\",\n\t};\n}\n\nfunction signalFrom(value: unknown): AbortSignal | undefined {\n\treturn value instanceof AbortSignal ? value : undefined;\n}\n\nconst CANCELLATION_V1 = Symbol(\"git-repository-capability-cancelled\");\n\nfunction runWithCancellation(\n\trun: () => Promise<GitRepositoryResultV1>,\n\tsignal: AbortSignal | undefined,\n): Promise<GitRepositoryResultV1 | typeof CANCELLATION_V1> {\n\tif (signal === undefined) return run();\n\tlet onAbort!: () => void;\n\tconst cancellation = new Promise<typeof CANCELLATION_V1>((resolve) => {\n\t\tonAbort = () => resolve(CANCELLATION_V1);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\treturn Promise.race([run(), cancellation]).finally(() => signal.removeEventListener(\"abort\", onAbort));\n}\n\n/** Registers a single read-only repository inspection tool with opaque input only. */\nexport function createGitRepositoryCapabilityFactoryV1(runtime: GitRepositoryAdapterV1): CapabilityPluginSyncFactory {\n\treturn (api) => {\n\t\tapi.registerTool({\n\t\t\tname: \"git_repository_inspect\",\n\t\t\tlabel: \"Inspect repository\",\n\t\t\tdescription: \"Read bounded git status, diff summary, or log summary through a host-owned workspace reference\",\n\t\t\tparameters: inputSchema,\n\t\t\texecute: async (first: unknown, second?: unknown, third?: unknown) => {\n\t\t\t\tlet call: { readonly input: Record<string, unknown>; readonly operationId: string };\n\t\t\t\ttry {\n\t\t\t\t\tcall = invocation(first, second);\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(\"profile-runtime-tool-call\", \"failed\");\n\t\t\t\t}\n\t\t\t\tconst signal = signalFrom(third);\n\t\t\t\tif (signal?.aborted) return fallback(call.operationId, \"cancelled\");\n\t\t\t\tif (!Value.Check(inputSchema, call.input)) return fallback(call.operationId, \"failed\");\n\t\t\t\tconst request = call.input.request as Record<string, unknown>;\n\t\t\t\ttry {\n\t\t\t\t\tconst output = await runWithCancellation(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\truntime.run(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\t\t\toperationId: call.operationId,\n\t\t\t\t\t\t\t\t\tworkspaceRef: request.workspaceRef as string,\n\t\t\t\t\t\t\t\t\toperation: request.operation as \"status\" | \"diff-summary\" | \"log-summary\",\n\t\t\t\t\t\t\t\t\t...(request.limit === undefined ? {} : { limit: request.limit as number }),\n\t\t\t\t\t\t\t\t\t...(request.timeoutMs === undefined ? {} : { timeoutMs: request.timeoutMs as number }),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t);\n\t\t\t\t\tif (output === CANCELLATION_V1) return fallback(call.operationId, \"cancelled\");\n\t\t\t\t\treturn projectGitRepositoryResultV1(output, call.operationId) ?? fallback(call.operationId, \"failed\");\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(call.operationId, \"failed\");\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t};\n}\n"]}
@@ -41,7 +41,11 @@ function fallback(operationId, status) {
41
41
  };
42
42
  }
43
43
  function objectInput(first, second) {
44
- const value = second === undefined ? first : second;
44
+ // Shape-based dual-convention read (aligned with subagent-delegate): the
45
+ // runtime invoke face passes the input object first and the host
46
+ // CapabilityToolContext second; the agent tool face passes the tool call
47
+ // id (a string) first and the params object second.
48
+ const value = first !== null && typeof first === "object" && !Array.isArray(first) ? first : second;
45
49
  if (value === null || typeof value !== "object" || Array.isArray(value))
46
50
  throw new Error("Git repository input must be an object");
47
51
  return value;
@@ -1 +1 @@
1
- {"version":3,"file":"capability.js","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AACA,OAAO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CAAC;oBACR,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC7C,CAAC;YAAA,CACD;SACD,CAAC,CAAC;IAAA,CACH,CAAC;AAAA,CACF","sourcesContent":["import type { CapabilityPluginSyncFactory } from \"@agent-forge/plugin-sdk\";\nimport { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n\tGIT_REPOSITORY_MAX_ENTRIES_V1,\n\tGIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\tGIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1,\n\tprojectGitRepositoryResultV1,\n} from \"./node-adapter.ts\";\nimport type { GitRepositoryAdapterV1, GitRepositoryResultV1 } from \"./types.ts\";\n\nconst requestSchema = Type.Object(\n\t{\n\t\tworkspaceRef: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: GIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\t\t\tpattern: \"^[A-Za-z0-9][A-Za-z0-9._:-]*$\",\n\t\t}),\n\t\toperation: Type.Union([Type.Literal(\"status\"), Type.Literal(\"diff-summary\"), Type.Literal(\"log-summary\")]),\n\t\tlimit: Type.Optional(Type.Integer({ minimum: 1, maximum: GIT_REPOSITORY_MAX_ENTRIES_V1 })),\n\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 120_000 })),\n\t},\n\t{ additionalProperties: false },\n);\nconst inputSchema = Type.Object({ request: requestSchema }, { additionalProperties: false });\n\nfunction emptySummary(): GitRepositoryResultV1[\"summary\"] {\n\treturn {\n\t\tfilesChanged: 0,\n\t\tadded: 0,\n\t\tmodified: 0,\n\t\tdeleted: 0,\n\t\tuntracked: 0,\n\t\tconflicted: 0,\n\t\tadditions: 0,\n\t\tdeletions: 0,\n\t\tcommits: 0,\n\t};\n}\n\nfunction fallback(operationId: string, status: \"failed\" | \"cancelled\"): GitRepositoryResultV1 {\n\treturn {\n\t\tversion: 1,\n\t\toperationId,\n\t\tstatus,\n\t\tsummary: emptySummary(),\n\t\tentries: [],\n\t\tentriesTruncated: false,\n\t\terror: {\n\t\t\tversion: 1,\n\t\t\tcode: status === \"cancelled\" ? \"cancelled\" : \"adapter_failed\",\n\t\t\tmessage: status === \"cancelled\" ? \"Git repository read was cancelled\" : \"Git repository adapter failed\",\n\t\t},\n\t};\n}\n\nfunction objectInput(first: unknown, second: unknown): Record<string, unknown> {\n\tconst value = second === undefined ? first : second;\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value))\n\t\tthrow new Error(\"Git repository input must be an object\");\n\treturn value as Record<string, unknown>;\n}\n\nfunction invocation(\n\tfirst: unknown,\n\tsecond: unknown,\n): { readonly input: Record<string, unknown>; readonly operationId: string } {\n\tconst candidate = typeof first === \"string\" && first.trim() !== \"\" ? first : \"profile-runtime-tool-call\";\n\treturn {\n\t\tinput: objectInput(first, second),\n\t\toperationId:\n\t\t\tcandidate.length <= GIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1 ? candidate : \"profile-runtime-tool-call\",\n\t};\n}\n\nfunction signalFrom(value: unknown): AbortSignal | undefined {\n\treturn value instanceof AbortSignal ? value : undefined;\n}\n\nconst CANCELLATION_V1 = Symbol(\"git-repository-capability-cancelled\");\n\nfunction runWithCancellation(\n\trun: () => Promise<GitRepositoryResultV1>,\n\tsignal: AbortSignal | undefined,\n): Promise<GitRepositoryResultV1 | typeof CANCELLATION_V1> {\n\tif (signal === undefined) return run();\n\tlet onAbort!: () => void;\n\tconst cancellation = new Promise<typeof CANCELLATION_V1>((resolve) => {\n\t\tonAbort = () => resolve(CANCELLATION_V1);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\treturn Promise.race([run(), cancellation]).finally(() => signal.removeEventListener(\"abort\", onAbort));\n}\n\n/** Registers a single read-only repository inspection tool with opaque input only. */\nexport function createGitRepositoryCapabilityFactoryV1(runtime: GitRepositoryAdapterV1): CapabilityPluginSyncFactory {\n\treturn (api) => {\n\t\tapi.registerTool({\n\t\t\tname: \"git_repository_inspect\",\n\t\t\tlabel: \"Inspect repository\",\n\t\t\tdescription: \"Read bounded git status, diff summary, or log summary through a host-owned workspace reference\",\n\t\t\tparameters: inputSchema,\n\t\t\texecute: async (first: unknown, second?: unknown, third?: unknown) => {\n\t\t\t\tlet call: { readonly input: Record<string, unknown>; readonly operationId: string };\n\t\t\t\ttry {\n\t\t\t\t\tcall = invocation(first, second);\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(\"profile-runtime-tool-call\", \"failed\");\n\t\t\t\t}\n\t\t\t\tconst signal = signalFrom(third);\n\t\t\t\tif (signal?.aborted) return fallback(call.operationId, \"cancelled\");\n\t\t\t\tif (!Value.Check(inputSchema, call.input)) return fallback(call.operationId, \"failed\");\n\t\t\t\tconst request = call.input.request as Record<string, unknown>;\n\t\t\t\ttry {\n\t\t\t\t\tconst output = await runWithCancellation(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\truntime.run(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\t\t\toperationId: call.operationId,\n\t\t\t\t\t\t\t\t\tworkspaceRef: request.workspaceRef as string,\n\t\t\t\t\t\t\t\t\toperation: request.operation as \"status\" | \"diff-summary\" | \"log-summary\",\n\t\t\t\t\t\t\t\t\t...(request.limit === undefined ? {} : { limit: request.limit as number }),\n\t\t\t\t\t\t\t\t\t...(request.timeoutMs === undefined ? {} : { timeoutMs: request.timeoutMs as number }),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t);\n\t\t\t\t\tif (output === CANCELLATION_V1) return fallback(call.operationId, \"cancelled\");\n\t\t\t\t\treturn projectGitRepositoryResultV1(output, call.operationId) ?? fallback(call.operationId, \"failed\");\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(call.operationId, \"failed\");\n\t\t\t\t}\n\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I,MAAM,KAAK,eAAe;wBAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;oBAC/E,OAAO,4BAA4B,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBACvG,CAAC;gBAAC,MAAM,CAAC;oBACR,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC7C,CAAC;YAAA,CACD;SACD,CAAC,CAAC;IAAA,CACH,CAAC;AAAA,CACF","sourcesContent":["import type { CapabilityPluginSyncFactory } from \"@agent-forge/plugin-sdk\";\nimport { Type } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n\tGIT_REPOSITORY_MAX_ENTRIES_V1,\n\tGIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\tGIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1,\n\tprojectGitRepositoryResultV1,\n} from \"./node-adapter.ts\";\nimport type { GitRepositoryAdapterV1, GitRepositoryResultV1 } from \"./types.ts\";\n\nconst requestSchema = Type.Object(\n\t{\n\t\tworkspaceRef: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: GIT_REPOSITORY_MAX_OPAQUE_REF_CHARS_V1,\n\t\t\tpattern: \"^[A-Za-z0-9][A-Za-z0-9._:-]*$\",\n\t\t}),\n\t\toperation: Type.Union([Type.Literal(\"status\"), Type.Literal(\"diff-summary\"), Type.Literal(\"log-summary\")]),\n\t\tlimit: Type.Optional(Type.Integer({ minimum: 1, maximum: GIT_REPOSITORY_MAX_ENTRIES_V1 })),\n\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 120_000 })),\n\t},\n\t{ additionalProperties: false },\n);\nconst inputSchema = Type.Object({ request: requestSchema }, { additionalProperties: false });\n\nfunction emptySummary(): GitRepositoryResultV1[\"summary\"] {\n\treturn {\n\t\tfilesChanged: 0,\n\t\tadded: 0,\n\t\tmodified: 0,\n\t\tdeleted: 0,\n\t\tuntracked: 0,\n\t\tconflicted: 0,\n\t\tadditions: 0,\n\t\tdeletions: 0,\n\t\tcommits: 0,\n\t};\n}\n\nfunction fallback(operationId: string, status: \"failed\" | \"cancelled\"): GitRepositoryResultV1 {\n\treturn {\n\t\tversion: 1,\n\t\toperationId,\n\t\tstatus,\n\t\tsummary: emptySummary(),\n\t\tentries: [],\n\t\tentriesTruncated: false,\n\t\terror: {\n\t\t\tversion: 1,\n\t\t\tcode: status === \"cancelled\" ? \"cancelled\" : \"adapter_failed\",\n\t\t\tmessage: status === \"cancelled\" ? \"Git repository read was cancelled\" : \"Git repository adapter failed\",\n\t\t},\n\t};\n}\n\nfunction objectInput(first: unknown, second: unknown): Record<string, unknown> {\n\t// Shape-based dual-convention read (aligned with subagent-delegate): the\n\t// runtime invoke face passes the input object first and the host\n\t// CapabilityToolContext second; the agent tool face passes the tool call\n\t// id (a string) first and the params object second.\n\tconst value = first !== null && typeof first === \"object\" && !Array.isArray(first) ? first : second;\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value))\n\t\tthrow new Error(\"Git repository input must be an object\");\n\treturn value as Record<string, unknown>;\n}\n\nfunction invocation(\n\tfirst: unknown,\n\tsecond: unknown,\n): { readonly input: Record<string, unknown>; readonly operationId: string } {\n\tconst candidate = typeof first === \"string\" && first.trim() !== \"\" ? first : \"profile-runtime-tool-call\";\n\treturn {\n\t\tinput: objectInput(first, second),\n\t\toperationId:\n\t\t\tcandidate.length <= GIT_REPOSITORY_MAX_OPERATION_ID_CHARS_V1 ? candidate : \"profile-runtime-tool-call\",\n\t};\n}\n\nfunction signalFrom(value: unknown): AbortSignal | undefined {\n\treturn value instanceof AbortSignal ? value : undefined;\n}\n\nconst CANCELLATION_V1 = Symbol(\"git-repository-capability-cancelled\");\n\nfunction runWithCancellation(\n\trun: () => Promise<GitRepositoryResultV1>,\n\tsignal: AbortSignal | undefined,\n): Promise<GitRepositoryResultV1 | typeof CANCELLATION_V1> {\n\tif (signal === undefined) return run();\n\tlet onAbort!: () => void;\n\tconst cancellation = new Promise<typeof CANCELLATION_V1>((resolve) => {\n\t\tonAbort = () => resolve(CANCELLATION_V1);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\treturn Promise.race([run(), cancellation]).finally(() => signal.removeEventListener(\"abort\", onAbort));\n}\n\n/** Registers a single read-only repository inspection tool with opaque input only. */\nexport function createGitRepositoryCapabilityFactoryV1(runtime: GitRepositoryAdapterV1): CapabilityPluginSyncFactory {\n\treturn (api) => {\n\t\tapi.registerTool({\n\t\t\tname: \"git_repository_inspect\",\n\t\t\tlabel: \"Inspect repository\",\n\t\t\tdescription: \"Read bounded git status, diff summary, or log summary through a host-owned workspace reference\",\n\t\t\tparameters: inputSchema,\n\t\t\texecute: async (first: unknown, second?: unknown, third?: unknown) => {\n\t\t\t\tlet call: { readonly input: Record<string, unknown>; readonly operationId: string };\n\t\t\t\ttry {\n\t\t\t\t\tcall = invocation(first, second);\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(\"profile-runtime-tool-call\", \"failed\");\n\t\t\t\t}\n\t\t\t\tconst signal = signalFrom(third);\n\t\t\t\tif (signal?.aborted) return fallback(call.operationId, \"cancelled\");\n\t\t\t\tif (!Value.Check(inputSchema, call.input)) return fallback(call.operationId, \"failed\");\n\t\t\t\tconst request = call.input.request as Record<string, unknown>;\n\t\t\t\ttry {\n\t\t\t\t\tconst output = await runWithCancellation(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\truntime.run(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tversion: 1,\n\t\t\t\t\t\t\t\t\toperationId: call.operationId,\n\t\t\t\t\t\t\t\t\tworkspaceRef: request.workspaceRef as string,\n\t\t\t\t\t\t\t\t\toperation: request.operation as \"status\" | \"diff-summary\" | \"log-summary\",\n\t\t\t\t\t\t\t\t\t...(request.limit === undefined ? {} : { limit: request.limit as number }),\n\t\t\t\t\t\t\t\t\t...(request.timeoutMs === undefined ? {} : { timeoutMs: request.timeoutMs as number }),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t);\n\t\t\t\t\tif (output === CANCELLATION_V1) return fallback(call.operationId, \"cancelled\");\n\t\t\t\t\treturn projectGitRepositoryResultV1(output, call.operationId) ?? fallback(call.operationId, \"failed\");\n\t\t\t\t} catch {\n\t\t\t\t\treturn fallback(call.operationId, \"failed\");\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t};\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-agent-forge/plugin-git-repository",
3
- "version": "0.85.5",
3
+ "version": "0.85.7",
4
4
  "description": "Git repository capability plugin for Agent Forge (read-only git_repository_inspect tool)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,11 +44,11 @@
44
44
  "node": ">=22.19.0"
45
45
  },
46
46
  "dependencies": {
47
- "@agent-forge/plugin-sdk": "^0.85.5",
47
+ "@agent-forge/plugin-sdk": "^0.85.7",
48
48
  "typebox": "1.3.27"
49
49
  },
50
50
  "devDependencies": {
51
- "@agent-forge/agent-forge": "^0.85.5",
51
+ "@agent-forge/agent-forge": "^0.85.7",
52
52
  "shx": "0.4.0",
53
53
  "vitest": "4.1.9"
54
54
  }
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "agent-forge.plugin.git-repository",
3
- "version": "0.85.5",
3
+ "version": "0.85.7",
4
4
  "apiVersion": "1-draft",
5
5
  "entry": "./dist/entry.js",
6
6
  "hostVersion": ">=0.84.4",