plugin-agent-orchestrator 1.0.13 → 1.0.14

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 (251) hide show
  1. package/README.md +16 -291
  2. package/dist/client/AIEmployeesContext.d.ts +7 -0
  3. package/dist/client/OrchestratorSettings.d.ts +2 -1
  4. package/dist/client/index.js +1 -1
  5. package/dist/client/plugin.d.ts +1 -0
  6. package/dist/client/skill-hub/components/ExecutionHistory.d.ts +2 -0
  7. package/dist/client/skill-hub/components/ExecutionProgress.d.ts +20 -0
  8. package/dist/client/skill-hub/components/GitSkillImport.d.ts +7 -0
  9. package/dist/client/skill-hub/components/SkillEditor.d.ts +7 -0
  10. package/dist/client/skill-hub/components/SkillManager.d.ts +2 -0
  11. package/dist/client/skill-hub/components/SkillMetrics.d.ts +2 -0
  12. package/dist/client/skill-hub/components/SkillTestPanel.d.ts +7 -0
  13. package/dist/client/skill-hub/index.d.ts +10 -0
  14. package/dist/client/skill-hub/locale.d.ts +3 -0
  15. package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +19 -0
  16. package/dist/client/skill-hub/tools/SkillHubCard.d.ts +3 -0
  17. package/dist/client/skill-hub/utils/jsonFields.d.ts +3 -0
  18. package/dist/externalVersion.js +6 -6
  19. package/dist/node_modules/adm-zip/LICENSE +21 -0
  20. package/dist/node_modules/adm-zip/adm-zip.js +1 -0
  21. package/dist/node_modules/adm-zip/headers/entryHeader.js +377 -0
  22. package/dist/node_modules/adm-zip/headers/index.js +2 -0
  23. package/dist/node_modules/adm-zip/headers/mainHeader.js +130 -0
  24. package/dist/node_modules/adm-zip/methods/deflater.js +33 -0
  25. package/dist/node_modules/adm-zip/methods/index.js +3 -0
  26. package/dist/node_modules/adm-zip/methods/inflater.js +34 -0
  27. package/dist/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  28. package/dist/node_modules/adm-zip/package.json +1 -0
  29. package/dist/node_modules/adm-zip/util/constants.js +142 -0
  30. package/dist/node_modules/adm-zip/util/decoder.js +5 -0
  31. package/dist/node_modules/adm-zip/util/errors.js +63 -0
  32. package/dist/node_modules/adm-zip/util/fattr.js +76 -0
  33. package/dist/node_modules/adm-zip/util/index.js +5 -0
  34. package/dist/node_modules/adm-zip/util/utils.js +339 -0
  35. package/dist/node_modules/adm-zip/zipEntry.js +405 -0
  36. package/dist/node_modules/adm-zip/zipFile.js +446 -0
  37. package/dist/node_modules/simple-git/dist/cjs/index.js +7399 -0
  38. package/dist/node_modules/simple-git/dist/esm/index.js +4745 -0
  39. package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
  40. package/dist/node_modules/simple-git/dist/src/lib/api.d.ts +13 -0
  41. package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
  42. package/dist/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts +15 -0
  43. package/dist/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts +30 -0
  44. package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
  45. package/dist/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts +32 -0
  46. package/dist/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts +12 -0
  47. package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
  48. package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +21 -0
  49. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts +5 -0
  50. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +2 -0
  51. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts +2 -0
  52. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
  53. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts +2 -0
  54. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts +6 -0
  55. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts +11 -0
  56. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts +2 -0
  57. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts +6 -0
  58. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts +4 -0
  59. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts +5 -0
  60. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts +3 -0
  61. package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
  62. package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
  63. package/dist/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts +2 -0
  64. package/dist/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts +3 -0
  65. package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
  66. package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +7 -0
  67. package/dist/node_modules/simple-git/dist/src/lib/plugins/index.d.ts +11 -0
  68. package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
  69. package/dist/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts +3 -0
  70. package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +48 -0
  71. package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +3 -0
  72. package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
  73. package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
  74. package/dist/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts +12 -0
  75. package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
  76. package/dist/node_modules/simple-git/dist/src/lib/responses/CheckIgnore.d.ts +4 -0
  77. package/dist/node_modules/simple-git/dist/src/lib/responses/CleanSummary.d.ts +9 -0
  78. package/dist/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts +13 -0
  79. package/dist/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts +10 -0
  80. package/dist/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts +9 -0
  81. package/dist/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts +11 -0
  82. package/dist/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts +9 -0
  83. package/dist/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts +16 -0
  84. package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
  85. package/dist/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts +19 -0
  86. package/dist/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts +7 -0
  87. package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts +25 -0
  88. package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts +14 -0
  89. package/dist/node_modules/simple-git/dist/src/lib/runners/promise-wrapped.d.ts +2 -0
  90. package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +11 -0
  91. package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +23 -0
  92. package/dist/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts +20 -0
  93. package/dist/node_modules/simple-git/dist/src/lib/task-callback.d.ts +2 -0
  94. package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +3 -0
  95. package/dist/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts +7 -0
  96. package/dist/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts +2 -0
  97. package/dist/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts +2 -0
  98. package/dist/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts +9 -0
  99. package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
  100. package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +25 -0
  101. package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +9 -0
  102. package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
  103. package/dist/node_modules/simple-git/dist/src/lib/tasks/config.d.ts +8 -0
  104. package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
  105. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
  106. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
  107. package/dist/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts +4 -0
  108. package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
  109. package/dist/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts +12 -0
  110. package/dist/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts +5 -0
  111. package/dist/node_modules/simple-git/dist/src/lib/tasks/init.d.ts +3 -0
  112. package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +32 -0
  113. package/dist/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts +4 -0
  114. package/dist/node_modules/simple-git/dist/src/lib/tasks/move.d.ts +3 -0
  115. package/dist/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts +3 -0
  116. package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +9 -0
  117. package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +8 -0
  118. package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +11 -0
  119. package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
  120. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
  121. package/dist/node_modules/simple-git/dist/src/lib/tasks/status.d.ts +3 -0
  122. package/dist/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts +5 -0
  123. package/dist/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts +18 -0
  124. package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +14 -0
  125. package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
  126. package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +21 -0
  127. package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +136 -0
  128. package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +19 -0
  129. package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +14 -0
  130. package/dist/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts +10 -0
  131. package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +7 -0
  132. package/dist/node_modules/simple-git/dist/src/lib/utils/index.d.ts +8 -0
  133. package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +15 -0
  134. package/dist/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts +2 -0
  135. package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +13 -0
  136. package/dist/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts +5 -0
  137. package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +47 -0
  138. package/dist/node_modules/simple-git/dist/typings/errors.d.ts +5 -0
  139. package/dist/node_modules/simple-git/dist/typings/index.d.ts +14 -0
  140. package/dist/node_modules/simple-git/dist/typings/response.d.ts +556 -0
  141. package/dist/node_modules/simple-git/dist/typings/simple-git.d.ts +1033 -0
  142. package/dist/node_modules/simple-git/dist/typings/types.d.ts +22 -0
  143. package/dist/node_modules/simple-git/node_modules/debug/package.json +64 -0
  144. package/dist/node_modules/simple-git/node_modules/debug/src/browser.js +272 -0
  145. package/dist/node_modules/simple-git/node_modules/debug/src/common.js +292 -0
  146. package/dist/node_modules/simple-git/node_modules/debug/src/index.js +10 -0
  147. package/dist/node_modules/simple-git/node_modules/debug/src/node.js +263 -0
  148. package/dist/node_modules/simple-git/package.json +1 -0
  149. package/dist/node_modules/simple-git/promise.js +17 -0
  150. package/dist/server/collections/agent-execution-spans.d.ts +9 -0
  151. package/dist/server/collections/agent-execution-spans.js +152 -0
  152. package/dist/server/collections/orchestrator-config.js +6 -0
  153. package/dist/server/collections/skill-definitions.d.ts +3 -0
  154. package/dist/server/collections/skill-definitions.js +158 -0
  155. package/dist/server/collections/skill-executions.d.ts +3 -0
  156. package/dist/server/collections/skill-executions.js +123 -0
  157. package/dist/server/collections/skill-worker-configs.d.ts +3 -0
  158. package/dist/server/collections/skill-worker-configs.js +115 -0
  159. package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +4 -0
  160. package/dist/server/migrations/20260423000000-add-progress-fields.js +69 -0
  161. package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +4 -0
  162. package/dist/server/migrations/20260425000000-add-interaction-schema.js +61 -0
  163. package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +4 -0
  164. package/dist/server/migrations/20260427000000-change-packages-to-text.js +70 -0
  165. package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +4 -0
  166. package/dist/server/migrations/20260427000001-change-other-json-to-text.js +80 -0
  167. package/dist/server/migrations/20260429000000-add-llm-fields.js +8 -0
  168. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +16 -0
  169. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.js +51 -0
  170. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +7 -0
  171. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.js +57 -0
  172. package/dist/server/plugin.d.ts +3 -0
  173. package/dist/server/plugin.js +37 -1
  174. package/dist/server/resources/tracing.js +154 -11
  175. package/dist/server/services/CodeValidator.d.ts +32 -0
  176. package/dist/server/services/CodeValidator.js +205 -0
  177. package/dist/server/services/ExecutionSpanService.d.ts +44 -0
  178. package/dist/server/services/ExecutionSpanService.js +104 -0
  179. package/dist/server/services/FileManager.d.ts +28 -0
  180. package/dist/server/services/FileManager.js +151 -0
  181. package/dist/server/services/SandboxRunner.d.ts +41 -0
  182. package/dist/server/services/SandboxRunner.js +167 -0
  183. package/dist/server/services/SkillManager.d.ts +6 -0
  184. package/dist/server/services/SkillManager.js +640 -0
  185. package/dist/server/services/SkillRepositoryService.d.ts +22 -0
  186. package/dist/server/services/SkillRepositoryService.js +157 -0
  187. package/dist/server/services/WorkerEnvManager.d.ts +26 -0
  188. package/dist/server/services/WorkerEnvManager.js +120 -0
  189. package/dist/server/skill-hub/actions/git-import.d.ts +21 -0
  190. package/dist/server/skill-hub/actions/git-import.js +413 -0
  191. package/dist/server/skill-hub/mcp/McpController.d.ts +15 -0
  192. package/dist/server/skill-hub/mcp/McpController.js +111 -0
  193. package/dist/server/skill-hub/plugin.d.ts +58 -0
  194. package/dist/server/skill-hub/plugin.js +694 -0
  195. package/dist/server/skill-hub/sandbox-config.json +6 -0
  196. package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +14 -0
  197. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +267 -0
  198. package/dist/server/skill-hub/utils/json-fields.d.ts +7 -0
  199. package/dist/server/skill-hub/utils/json-fields.js +88 -0
  200. package/dist/server/tools/delegate-task.d.ts +4 -0
  201. package/dist/server/tools/delegate-task.js +606 -104
  202. package/dist/server/tools/skill-execute.d.ts +36 -0
  203. package/dist/server/tools/skill-execute.js +167 -0
  204. package/package.json +3 -1
  205. package/src/client/AIEmployeeSelect.tsx +1 -3
  206. package/src/client/AIEmployeesContext.tsx +28 -13
  207. package/src/client/OrchestratorSettings.tsx +43 -5
  208. package/src/client/RulesTab.tsx +253 -32
  209. package/src/client/TracingTab.tsx +277 -213
  210. package/src/client/plugin.tsx +39 -0
  211. package/src/client/skill-hub/components/ExecutionHistory.tsx +201 -0
  212. package/src/client/skill-hub/components/ExecutionProgress.tsx +55 -0
  213. package/src/client/skill-hub/components/GitSkillImport.tsx +555 -0
  214. package/src/client/skill-hub/components/SkillEditor.tsx +456 -0
  215. package/src/client/skill-hub/components/SkillManager.tsx +181 -0
  216. package/src/client/skill-hub/components/SkillMetrics.tsx +124 -0
  217. package/src/client/skill-hub/components/SkillTestPanel.tsx +144 -0
  218. package/src/client/skill-hub/index.tsx +75 -0
  219. package/src/client/skill-hub/locale.ts +16 -0
  220. package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +59 -0
  221. package/src/client/skill-hub/tools/SkillHubCard.tsx +78 -0
  222. package/src/client/skill-hub/utils/jsonFields.ts +37 -0
  223. package/src/server/collections/agent-execution-spans.ts +129 -0
  224. package/src/server/collections/orchestrator-config.ts +7 -0
  225. package/src/server/collections/skill-definitions.ts +128 -0
  226. package/src/server/collections/skill-executions.ts +94 -0
  227. package/src/server/collections/skill-worker-configs.ts +86 -0
  228. package/src/server/migrations/20260423000000-add-progress-fields.ts +50 -0
  229. package/src/server/migrations/20260425000000-add-interaction-schema.ts +35 -0
  230. package/src/server/migrations/20260427000000-change-packages-to-text.ts +47 -0
  231. package/src/server/migrations/20260427000001-change-other-json-to-text.ts +57 -0
  232. package/src/server/migrations/20260429000000-add-llm-fields.ts +9 -0
  233. package/src/server/migrations/20260429000000-fix-inputargs-json-to-text.ts +38 -0
  234. package/src/server/migrations/20260503000000-add-orchestrator-trace-fields.ts +32 -0
  235. package/src/server/plugin.ts +51 -3
  236. package/src/server/resources/tracing.ts +182 -15
  237. package/src/server/services/CodeValidator.ts +159 -0
  238. package/src/server/services/ExecutionSpanService.ts +106 -0
  239. package/src/server/services/FileManager.ts +144 -0
  240. package/src/server/services/SandboxRunner.ts +205 -0
  241. package/src/server/services/SkillManager.ts +623 -0
  242. package/src/server/services/SkillRepositoryService.ts +142 -0
  243. package/src/server/services/WorkerEnvManager.ts +113 -0
  244. package/src/server/skill-hub/actions/git-import.ts +486 -0
  245. package/src/server/skill-hub/mcp/McpController.ts +86 -0
  246. package/src/server/skill-hub/plugin.ts +771 -0
  247. package/src/server/skill-hub/sandbox-config.json +6 -0
  248. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +297 -0
  249. package/src/server/skill-hub/utils/json-fields.ts +57 -0
  250. package/src/server/tools/delegate-task.ts +803 -127
  251. package/src/server/tools/skill-execute.ts +157 -0
@@ -0,0 +1,5 @@
1
+ import type { MaybeArray, TaskParser, TaskResponseFormat } from '../types';
2
+ import { GitOutputStreams } from './git-output-streams';
3
+ import { LineParser } from './line-parser';
4
+ export declare function callTaskParser<INPUT extends TaskResponseFormat, RESPONSE>(parser: TaskParser<INPUT, RESPONSE>, streams: GitOutputStreams<INPUT>): RESPONSE;
5
+ export declare function parseStringResponse<T>(result: T, parsers: LineParser<T>[], texts: MaybeArray<string>, trim?: boolean): T;
@@ -0,0 +1,47 @@
1
+ import type { Maybe } from '../types';
2
+ type Callable = (...args: unknown[]) => unknown;
3
+ export declare const NULL = "\0";
4
+ export declare const NOOP: Callable;
5
+ /**
6
+ * Returns either the source argument when it is a `Function`, or the default
7
+ * `NOOP` function constant
8
+ */
9
+ export declare function asFunction<T>(source: T | unknown): Callable;
10
+ /**
11
+ * Determines whether the supplied argument is both a function, and is not
12
+ * the `NOOP` function.
13
+ */
14
+ export declare function isUserFunction<T extends Function>(source: T | unknown): source is T;
15
+ export declare function splitOn(input: string, char: string): [string, string];
16
+ export declare function first<T extends unknown[]>(input: T, offset?: number): Maybe<T[number]>;
17
+ export declare function first<T extends IArguments>(input: T, offset?: number): Maybe<unknown>;
18
+ export declare function last<T extends unknown[]>(input: T, offset?: number): Maybe<T[number]>;
19
+ export declare function last<T extends IArguments>(input: T, offset?: number): Maybe<unknown>;
20
+ export declare function last<T>(input: T, offset?: number): Maybe<unknown>;
21
+ export declare function toLinesWithContent(input?: string, trimmed?: boolean, separator?: string): string[];
22
+ type LineWithContentCallback<T = void> = (line: string) => T;
23
+ export declare function forEachLineWithContent<T>(input: string, callback: LineWithContentCallback<T>): T[];
24
+ export declare function folderExists(path: string): boolean;
25
+ /**
26
+ * Adds `item` into the `target` `Array` or `Set` when it is not already present and returns the `item`.
27
+ */
28
+ export declare function append<T>(target: T[] | Set<T>, item: T): typeof item;
29
+ /**
30
+ * Adds `item` into the `target` `Array` when it is not already present and returns the `target`.
31
+ */
32
+ export declare function including<T>(target: T[], item: T): typeof target;
33
+ export declare function remove<T>(target: Set<T> | T[], item: T): T;
34
+ export declare const objectToString: (input: unknown) => string;
35
+ export declare function asArray<T>(source: T | T[]): T[];
36
+ export declare function asCamelCase(str: string): string;
37
+ export declare function asStringArray<T>(source: T | T[]): string[];
38
+ export declare function asNumber(source: string | null | undefined, onNaN?: number): number;
39
+ export declare function prefixedArray<T>(input: T[], prefix: T): T[];
40
+ export declare function bufferToString(input: Buffer | Buffer[]): string;
41
+ /**
42
+ * Get a new object from a source object with only the listed properties.
43
+ */
44
+ export declare function pick<T, K extends keyof T>(source: T, properties: readonly K[]): Partial<Pick<T, K>>;
45
+ export declare function delay(duration?: number): Promise<void>;
46
+ export declare function orVoid<T>(input: T | false): T | undefined;
47
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from '../src/lib/errors/git-error';
2
+ export * from '../src/lib/errors/git-construct-error';
3
+ export * from '../src/lib/errors/git-plugin-error';
4
+ export * from '../src/lib/errors/git-response-error';
5
+ export * from '../src/lib/errors/task-configuration-error';
@@ -0,0 +1,14 @@
1
+ import { SimpleGitFactory } from './simple-git';
2
+
3
+ export { pathspec } from '@simple-git/args-pathspec';
4
+
5
+ export * from './simple-git';
6
+ export * from './errors';
7
+ export * from './response';
8
+ export * from './types';
9
+
10
+ export declare const gitP: SimpleGitFactory;
11
+
12
+ export declare const simpleGit: SimpleGitFactory;
13
+
14
+ export default simpleGit;
@@ -0,0 +1,556 @@
1
+ import type { DiffNameStatus } from '../src/lib/tasks/diff-name-status';
2
+ import type { DefaultLogFields } from '../src/lib/tasks/log';
3
+
4
+ export interface BranchSummaryBranch {
5
+ current: boolean;
6
+ name: string;
7
+ commit: string;
8
+ label: string;
9
+ linkedWorkTree: boolean;
10
+ }
11
+
12
+ export interface BranchSummary {
13
+ detached: boolean;
14
+ current: string;
15
+ all: string[];
16
+ branches: {
17
+ [key: string]: BranchSummaryBranch;
18
+ };
19
+ }
20
+
21
+ /**
22
+ * Represents the successful deletion of a single branch
23
+ */
24
+ export interface BranchSingleDeleteSuccess {
25
+ branch: string;
26
+ hash: string;
27
+ success: true;
28
+ }
29
+
30
+ /**
31
+ * Represents the failure to delete a single branch
32
+ */
33
+ export interface BranchSingleDeleteFailure {
34
+ branch: string;
35
+ hash: null;
36
+ success: false;
37
+ }
38
+
39
+ export type BranchSingleDeleteResult = BranchSingleDeleteFailure | BranchSingleDeleteSuccess;
40
+
41
+ /**
42
+ * Represents the status of having deleted a batch of branches
43
+ */
44
+ export interface BranchMultiDeleteResult {
45
+ /**
46
+ * All branches included in the response
47
+ */
48
+ all: BranchSingleDeleteResult[];
49
+
50
+ /**
51
+ * Branches mapped by their branch name
52
+ */
53
+ branches: { [branchName: string]: BranchSingleDeleteResult };
54
+
55
+ /**
56
+ * Array of responses that are in error
57
+ */
58
+ errors: BranchSingleDeleteResult[];
59
+
60
+ /**
61
+ * Flag showing whether all branches were deleted successfully
62
+ */
63
+ readonly success: boolean;
64
+ }
65
+
66
+ export interface CleanSummary {
67
+ readonly dryRun: boolean;
68
+ paths: string[];
69
+ files: string[];
70
+ folders: string[];
71
+ }
72
+
73
+ export interface CommitResult {
74
+ author: null | {
75
+ email: string;
76
+ name: string;
77
+ };
78
+ branch: string;
79
+ commit: string;
80
+ root: boolean;
81
+ summary: {
82
+ changes: number;
83
+ insertions: number;
84
+ deletions: number;
85
+ };
86
+ }
87
+
88
+ /** Represents the response to using `git.getConfig` */
89
+ export interface ConfigGetResult {
90
+ /** The key that was searched for */
91
+ key: string;
92
+
93
+ /** The single value seen by `git` for this key (equivalent to `git config --get key`) */
94
+ value: string | null;
95
+
96
+ /** All possible values for this key no matter the scope (equivalent to `git config --get-all key`) */
97
+ values: string[];
98
+
99
+ /** The file paths from which configuration was read */
100
+ paths: string[];
101
+
102
+ /**
103
+ * The full hierarchy of values the property can have had across the
104
+ * various scopes that were searched (keys in this Map are the strings
105
+ * also found in the `paths` array).
106
+ */
107
+ scopes: Map<string, string[]>;
108
+ }
109
+
110
+ /**
111
+ * Represents the current git configuration, as defined by the output from `git log`
112
+ */
113
+ export interface ConfigListSummary {
114
+ /**
115
+ * All configuration settings, where local/user settings override user/global settings
116
+ * the overridden value will appear in this object.
117
+ */
118
+ readonly all: ConfigValues;
119
+
120
+ /**
121
+ * The file paths configuration was read from
122
+ */
123
+ files: string[];
124
+
125
+ /**
126
+ * The `ConfigValues` for each of the `files`, use this object to determine
127
+ * local repo, user and global settings.
128
+ */
129
+ values: { [fileName: string]: ConfigValues };
130
+ }
131
+
132
+ /**
133
+ * Represents the map of configuration settings
134
+ */
135
+ export interface ConfigValues {
136
+ [key: string]: string | string[];
137
+ }
138
+
139
+ export interface DiffResultTextFile {
140
+ file: string;
141
+ changes: number;
142
+ insertions: number;
143
+ deletions: number;
144
+ binary: false;
145
+ }
146
+
147
+ export interface DiffResultBinaryFile {
148
+ file: string;
149
+ before: number;
150
+ after: number;
151
+ binary: true;
152
+ }
153
+
154
+ /** `--name-status` argument needed */
155
+ export interface DiffResultNameStatusFile extends DiffResultTextFile {
156
+ status?: DiffNameStatus;
157
+ from?: string;
158
+ similarity: number;
159
+ }
160
+
161
+ export interface DiffResult {
162
+ /** The total number of files changed as reported in the summary line */
163
+ changed: number;
164
+
165
+ /** When present in the diff, lists the details of each file changed */
166
+ files: Array<DiffResultTextFile | DiffResultBinaryFile | DiffResultNameStatusFile>;
167
+
168
+ /** The number of files changed with insertions */
169
+ insertions: number;
170
+
171
+ /** The number of files changed with deletions */
172
+ deletions: number;
173
+ }
174
+
175
+ export interface FetchResult {
176
+ raw: string;
177
+ remote: string | null;
178
+ branches: {
179
+ name: string;
180
+ tracking: string;
181
+ }[];
182
+ tags: {
183
+ name: string;
184
+ tracking: string;
185
+ }[];
186
+ updated: {
187
+ name: string;
188
+ tracking: string;
189
+ to: string;
190
+ from: string;
191
+ }[];
192
+ deleted: {
193
+ tracking: string;
194
+ }[];
195
+ }
196
+
197
+ /** Represents the response to git.grep */
198
+ export interface GrepResult {
199
+ paths: Set<string>;
200
+ results: Record<
201
+ string,
202
+ Array<{
203
+ line: number;
204
+ path: string;
205
+ preview: string;
206
+ }>
207
+ >;
208
+ }
209
+
210
+ /**
211
+ * The `InitResult` is returned when (re)initialising a git repo.
212
+ */
213
+ export interface InitResult {
214
+ /**
215
+ * Boolean representing whether the `--bare` option was used
216
+ */
217
+ readonly bare: boolean;
218
+
219
+ /**
220
+ * Boolean representing whether the repo already existed (re-initialised rather than initialised)
221
+ */
222
+ readonly existing: boolean;
223
+
224
+ /**
225
+ * The path used when initialising
226
+ */
227
+ readonly path: string;
228
+
229
+ /**
230
+ * The git configuration directory - for a bare repo this is the same as `path`, in non-bare repos
231
+ * this will usually be a sub-directory with the name `.git` (or value of the `$GIT_DIR` environment
232
+ * variable).
233
+ */
234
+ readonly gitDir: string;
235
+ }
236
+
237
+ /**
238
+ * A parsed response summary for calls to `git mv`
239
+ */
240
+ export interface MoveResult {
241
+ /**
242
+ * Array of files moved
243
+ */
244
+ moves: Array<{ from: string; to: string }>;
245
+ }
246
+
247
+ export interface PullDetailFileChanges {
248
+ [fileName: string]: number;
249
+ }
250
+
251
+ export interface PullDetailSummary {
252
+ changes: number;
253
+ insertions: number;
254
+ deletions: number;
255
+ }
256
+
257
+ export interface PullDetail {
258
+ /** Array of all files that are referenced in the pull */
259
+ files: string[];
260
+
261
+ /** Map of file names to the number of insertions in that file */
262
+ insertions: PullDetailFileChanges;
263
+
264
+ /** Map of file names to the number of deletions in that file */
265
+ deletions: PullDetailFileChanges;
266
+
267
+ summary: PullDetailSummary;
268
+
269
+ /** Array of file names that have been created */
270
+ created: string[];
271
+
272
+ /** Array of file names that have been deleted */
273
+ deleted: string[];
274
+ }
275
+
276
+ export interface PullResult extends PullDetail, RemoteMessageResult {}
277
+
278
+ /**
279
+ * Wrapped with the `GitResponseError` as the exception thrown from a `git.pull` task
280
+ * to provide additional detail as to what failed.
281
+ */
282
+ export interface PullFailedResult {
283
+ remote: string;
284
+ hash: {
285
+ local: string;
286
+ remote: string;
287
+ };
288
+ branch: {
289
+ local: string;
290
+ remote: string;
291
+ };
292
+ message: string;
293
+ }
294
+
295
+ /**
296
+ * Represents file name changes in a StatusResult
297
+ */
298
+ export interface StatusResultRenamed {
299
+ from: string;
300
+ to: string;
301
+ }
302
+
303
+ export interface FileStatusResult {
304
+ /** Original location of the file, when the file has been moved */
305
+ from?: string;
306
+
307
+ /** Path of the file */
308
+ path: string;
309
+
310
+ /** First digit of the status code of the file, e.g. 'M' = modified.
311
+ Represents the status of the index if no merge conflicts, otherwise represents
312
+ status of one side of the merge. */
313
+ index: string;
314
+
315
+ /** Second digit of the status code of the file. Represents status of the working directory
316
+ if no merge conflicts, otherwise represents status of other side of a merge.
317
+ See https://git-scm.com/docs/git-status#_short_format for full documentation of possible
318
+ values and their meanings. */
319
+ working_dir: string;
320
+ }
321
+
322
+ /**
323
+ * The StatusResult is returned for calls to `git.status()`, represents the state of the
324
+ * working directory.
325
+ */
326
+ export interface StatusResult {
327
+ not_added: string[];
328
+ conflicted: string[];
329
+ created: string[];
330
+ deleted: string[];
331
+
332
+ /**
333
+ * Ignored files are not listed by default, add `--ignored` to the task options in order to see
334
+ * this array of ignored files/paths.
335
+ *
336
+ * Note: ignored files will not be added to the `files` array, and will not be included in the
337
+ * `isClean()` calculation.
338
+ */
339
+ ignored?: string[];
340
+ modified: string[];
341
+ renamed: StatusResultRenamed[];
342
+ staged: string[];
343
+
344
+ /**
345
+ * All files represented as an array of objects containing the `path` and status in `index` and
346
+ * in the `working_dir`.
347
+ */
348
+ files: FileStatusResult[];
349
+
350
+ /**
351
+ * Number of commits ahead of the tracked branch
352
+ */
353
+ ahead: number;
354
+
355
+ /**
356
+ *Number of commits behind the tracked branch
357
+ */
358
+ behind: number;
359
+
360
+ /**
361
+ * Name of the current branch
362
+ */
363
+ current: string | null;
364
+
365
+ /**
366
+ * Name of the branch being tracked
367
+ */
368
+ tracking: string | null;
369
+
370
+ /**
371
+ * Detached status of the working copy, for more detail of what the working branch
372
+ * is detached from use `git.branch()`
373
+ */
374
+ detached: boolean;
375
+
376
+ /**
377
+ * Gets whether this represents a clean working branch.
378
+ */
379
+ isClean(): boolean;
380
+ }
381
+
382
+ /**
383
+ * Response retrieved when using the `git.tags` method
384
+ */
385
+ export interface TagResult {
386
+ /**
387
+ * All tag names
388
+ */
389
+ all: string[];
390
+
391
+ /**
392
+ * The semver latest tag name or `undefined` when no tags are named in the response
393
+ */
394
+ latest: string | undefined;
395
+ }
396
+
397
+ /**
398
+ * The ListLogLine represents a single entry in the `git.log`, the properties on the object
399
+ * are mixed in depending on the names used in the format (see `DefaultLogFields`), but some
400
+ * properties are dependent on the command used.
401
+ */
402
+ export interface ListLogLine {
403
+ /**
404
+ * When using a `--stat=4096` or `--shortstat` options in the `git.log` or `git.stashList`,
405
+ * each entry in the `ListLogSummary` will also have a `diff` property representing as much
406
+ * detail as was given in the response.
407
+ */
408
+ diff?: DiffResult;
409
+ }
410
+
411
+ export interface LogResult<T = DefaultLogFields> {
412
+ all: ReadonlyArray<T & ListLogLine>;
413
+ total: number;
414
+ latest: (T & ListLogLine) | null;
415
+ }
416
+
417
+ /**
418
+ * Where the file was deleted, if there is a modify/delete conflict
419
+ */
420
+ export interface MergeConflictDeletion {
421
+ deleteRef: string;
422
+ }
423
+
424
+ /**
425
+ * Represents a single file with conflicts in the MergeSummary
426
+ */
427
+ export interface MergeConflict {
428
+ /**
429
+ * Type of conflict
430
+ */
431
+ reason: string;
432
+
433
+ /**
434
+ * Path to file
435
+ */
436
+ file: string | null;
437
+
438
+ /**
439
+ * Additional detail for the specific type of conflict
440
+ */
441
+ meta?: MergeConflictDeletion;
442
+ }
443
+
444
+ export type MergeResultStatus = 'success' | string;
445
+
446
+ export interface MergeDetail {
447
+ conflicts: MergeConflict[];
448
+ merges: string[];
449
+ result: MergeResultStatus;
450
+ readonly failed: boolean;
451
+ }
452
+
453
+ export type MergeResult = PullResult & MergeDetail;
454
+
455
+ /**
456
+ *
457
+ */
458
+ export interface PushResultPushedItem {
459
+ local: string;
460
+ remote: string;
461
+
462
+ readonly deleted: boolean;
463
+ readonly tag: boolean;
464
+ readonly branch: boolean;
465
+ readonly new: boolean;
466
+ readonly alreadyUpdated: boolean;
467
+ }
468
+
469
+ export interface RemoteMessagesObjectEnumeration {
470
+ enumerating: number;
471
+ counting: number;
472
+ compressing: number;
473
+ total: {
474
+ count: number;
475
+ delta: number;
476
+ };
477
+ reused: {
478
+ count: number;
479
+ delta: number;
480
+ };
481
+ packReused: number;
482
+ }
483
+
484
+ export interface RemoteMessages {
485
+ all: string[];
486
+ objects?: RemoteMessagesObjectEnumeration;
487
+ }
488
+
489
+ export interface PushResultRemoteMessages extends RemoteMessages {
490
+ pullRequestUrl?: string;
491
+ vulnerabilities?: {
492
+ count: number;
493
+ summary: string;
494
+ url: string;
495
+ };
496
+ }
497
+
498
+ export interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> {
499
+ remoteMessages: T;
500
+ }
501
+
502
+ export interface PushResultBranchUpdate {
503
+ head: {
504
+ local: string;
505
+ remote: string;
506
+ };
507
+ hash: {
508
+ from: string;
509
+ to: string;
510
+ };
511
+ }
512
+
513
+ export interface PushDetail {
514
+ repo?: string;
515
+ ref?: {
516
+ local: string;
517
+ };
518
+ pushed: PushResultPushedItem[];
519
+ branch?: {
520
+ local: string;
521
+ remote: string;
522
+ remoteName: string;
523
+ };
524
+ update?: PushResultBranchUpdate;
525
+ }
526
+
527
+ export interface PushResult extends PushDetail, RemoteMessageResult<PushResultRemoteMessages> {}
528
+
529
+ /**
530
+ * @deprecated
531
+ * For consistent naming, please use `CommitResult` instead of `CommitSummary`
532
+ */
533
+ export type CommitSummary = CommitResult;
534
+
535
+ /**
536
+ * @deprecated
537
+ * For consistent naming, please use `MergeResult` instead of `MergeSummary`
538
+ */
539
+ export type MergeSummary = MergeResult;
540
+
541
+ /**
542
+ * @deprecated to aid consistent naming, please use `BranchSingleDeleteResult` instead of `BranchDeletionSummary`.
543
+ */
544
+ export type BranchDeletionSummary = BranchSingleDeleteResult;
545
+
546
+ /**
547
+ * @deprecated to aid consistent naming, please use `BranchMultiDeleteResult` instead of `BranchDeletionBatchSummary`.
548
+ */
549
+ export type BranchDeletionBatchSummary = BranchMultiDeleteResult;
550
+
551
+ export type MoveSummary = MoveResult;
552
+
553
+ /**
554
+ * @deprecated to aid consistent naming, please use `LogResult` instead of `ListLogSummary`.
555
+ */
556
+ export type ListLogSummary<T = DefaultLogFields> = LogResult<T>;