@nntoan/gstack 0.0.1

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 (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/bin/gstack.js +2 -0
  4. package/dist/agents/builder.d.ts +2 -0
  5. package/dist/agents/ceo.d.ts +2 -0
  6. package/dist/agents/debugger.d.ts +2 -0
  7. package/dist/agents/designer.d.ts +2 -0
  8. package/dist/agents/doc-engineer.d.ts +2 -0
  9. package/dist/agents/eng-manager.d.ts +2 -0
  10. package/dist/agents/index.d.ts +21 -0
  11. package/dist/agents/qa-lead.d.ts +2 -0
  12. package/dist/agents/release-engineer.d.ts +2 -0
  13. package/dist/agents/retro-lead.d.ts +2 -0
  14. package/dist/agents/reviewer.d.ts +2 -0
  15. package/dist/agents/safety-guard.d.ts +2 -0
  16. package/dist/agents/session-manager.d.ts +2 -0
  17. package/dist/agents/types.d.ts +7 -0
  18. package/dist/agents/upgrader.d.ts +2 -0
  19. package/dist/cli/cli-program.d.ts +1 -0
  20. package/dist/cli/doctor/checks/config.d.ts +2 -0
  21. package/dist/cli/doctor/checks/index.d.ts +1 -0
  22. package/dist/cli/doctor/checks/mcp.d.ts +7 -0
  23. package/dist/cli/doctor/checks/system.d.ts +2 -0
  24. package/dist/cli/doctor/checks/tools.d.ts +2 -0
  25. package/dist/cli/doctor/index.d.ts +2 -0
  26. package/dist/cli/doctor/runner.d.ts +12 -0
  27. package/dist/cli/doctor/types.d.ts +11 -0
  28. package/dist/cli/index.d.ts +2 -0
  29. package/dist/cli/install.d.ts +10 -0
  30. package/dist/cli.js +17011 -0
  31. package/dist/config/merge-configs.d.ts +2 -0
  32. package/dist/config/schema/agent-schema.d.ts +13 -0
  33. package/dist/config/schema/backlog-schema.d.ts +7 -0
  34. package/dist/config/schema/browser-schema.d.ts +6 -0
  35. package/dist/config/schema/constants.d.ts +1 -0
  36. package/dist/config/schema/index.d.ts +7 -0
  37. package/dist/config/schema/main.d.ts +150 -0
  38. package/dist/config/schema/mcp-schema.d.ts +51 -0
  39. package/dist/config/schema/telemetry-schema.d.ts +9 -0
  40. package/dist/create-hooks.d.ts +9 -0
  41. package/dist/create-managers.d.ts +17 -0
  42. package/dist/create-skills-and-agents.d.ts +8 -0
  43. package/dist/create-tools.d.ts +9 -0
  44. package/dist/features/analytics/eureka-tracker.d.ts +2 -0
  45. package/dist/features/analytics/index.d.ts +12 -0
  46. package/dist/features/analytics/skill-usage-tracker.d.ts +2 -0
  47. package/dist/features/analytics/sprint-logger.d.ts +2 -0
  48. package/dist/features/analytics/types.d.ts +38 -0
  49. package/dist/features/analytics/writer.d.ts +2 -0
  50. package/dist/features/browser-daemon/browser-manager.d.ts +99 -0
  51. package/dist/features/browser-daemon/buffers.d.ts +43 -0
  52. package/dist/features/browser-daemon/cli.d.ts +12 -0
  53. package/dist/features/browser-daemon/commands.d.ts +13 -0
  54. package/dist/features/browser-daemon/config.d.ts +6 -0
  55. package/dist/features/browser-daemon/cookie-import-browser.d.ts +70 -0
  56. package/dist/features/browser-daemon/cookie-picker-routes.d.ts +16 -0
  57. package/dist/features/browser-daemon/cookie-picker-ui.d.ts +9 -0
  58. package/dist/features/browser-daemon/find-browse.d.ts +7 -0
  59. package/dist/features/browser-daemon/index.d.ts +17 -0
  60. package/dist/features/browser-daemon/meta-commands.d.ts +6 -0
  61. package/dist/features/browser-daemon/platform.d.ts +3 -0
  62. package/dist/features/browser-daemon/read-commands.d.ts +11 -0
  63. package/dist/features/browser-daemon/server.d.ts +27 -0
  64. package/dist/features/browser-daemon/snapshot.d.ts +36 -0
  65. package/dist/features/browser-daemon/types.d.ts +31 -0
  66. package/dist/features/browser-daemon/url-validation.d.ts +5 -0
  67. package/dist/features/browser-daemon/write-commands.d.ts +8 -0
  68. package/dist/features/builtin-skills/index.d.ts +3 -0
  69. package/dist/features/builtin-skills/skills/benchmark.d.ts +2 -0
  70. package/dist/features/builtin-skills/skills/browse.d.ts +2 -0
  71. package/dist/features/builtin-skills/skills/canary.d.ts +2 -0
  72. package/dist/features/builtin-skills/skills/careful.d.ts +2 -0
  73. package/dist/features/builtin-skills/skills/codex.d.ts +2 -0
  74. package/dist/features/builtin-skills/skills/design-consultation.d.ts +2 -0
  75. package/dist/features/builtin-skills/skills/design-review.d.ts +2 -0
  76. package/dist/features/builtin-skills/skills/document-release.d.ts +2 -0
  77. package/dist/features/builtin-skills/skills/freeze.d.ts +2 -0
  78. package/dist/features/builtin-skills/skills/guard.d.ts +2 -0
  79. package/dist/features/builtin-skills/skills/index.d.ts +25 -0
  80. package/dist/features/builtin-skills/skills/investigate.d.ts +2 -0
  81. package/dist/features/builtin-skills/skills/land-and-deploy.d.ts +2 -0
  82. package/dist/features/builtin-skills/skills/office-hours.d.ts +2 -0
  83. package/dist/features/builtin-skills/skills/plan-ceo-review.d.ts +2 -0
  84. package/dist/features/builtin-skills/skills/plan-design-review.d.ts +2 -0
  85. package/dist/features/builtin-skills/skills/plan-eng-review.d.ts +2 -0
  86. package/dist/features/builtin-skills/skills/qa-only.d.ts +2 -0
  87. package/dist/features/builtin-skills/skills/qa.d.ts +2 -0
  88. package/dist/features/builtin-skills/skills/retro.d.ts +2 -0
  89. package/dist/features/builtin-skills/skills/review.d.ts +2 -0
  90. package/dist/features/builtin-skills/skills/setup-browser-cookies.d.ts +2 -0
  91. package/dist/features/builtin-skills/skills/setup-deploy.d.ts +2 -0
  92. package/dist/features/builtin-skills/skills/ship.d.ts +2 -0
  93. package/dist/features/builtin-skills/skills/unfreeze.d.ts +2 -0
  94. package/dist/features/builtin-skills/skills/upgrade.d.ts +2 -0
  95. package/dist/features/builtin-skills/skills.d.ts +3 -0
  96. package/dist/features/builtin-skills/types.d.ts +4 -0
  97. package/dist/features/orchestrator/delegation-engine.d.ts +19 -0
  98. package/dist/features/orchestrator/index.d.ts +21 -0
  99. package/dist/features/orchestrator/intent-classifier.d.ts +3 -0
  100. package/dist/features/orchestrator/intent-patterns.d.ts +4 -0
  101. package/dist/features/orchestrator/types.d.ts +22 -0
  102. package/dist/features/skill-adapter/content-transformer.d.ts +12 -0
  103. package/dist/features/skill-adapter/index.d.ts +4 -0
  104. package/dist/features/skill-adapter/placeholder-content.d.ts +5 -0
  105. package/dist/features/skill-adapter/template-resolver.d.ts +14 -0
  106. package/dist/features/skill-mcp-manager/cleanup.d.ts +4 -0
  107. package/dist/features/skill-mcp-manager/connection.d.ts +4 -0
  108. package/dist/features/skill-mcp-manager/index.d.ts +2 -0
  109. package/dist/features/skill-mcp-manager/manager.d.ts +19 -0
  110. package/dist/features/skill-mcp-manager/types.d.ts +33 -0
  111. package/dist/features/sprint-backlog/backlog-client.d.ts +18 -0
  112. package/dist/features/sprint-backlog/build-status-updater.d.ts +8 -0
  113. package/dist/features/sprint-backlog/graceful-degradation.d.ts +1 -0
  114. package/dist/features/sprint-backlog/index.d.ts +21 -0
  115. package/dist/features/sprint-backlog/ship-readiness-checker.d.ts +10 -0
  116. package/dist/features/sprint-backlog/think-plan-creator.d.ts +6 -0
  117. package/dist/features/sprint-backlog/types.d.ts +23 -0
  118. package/dist/features/workspace-state/boulder-storage.d.ts +16 -0
  119. package/dist/features/workspace-state/constants.d.ts +12 -0
  120. package/dist/features/workspace-state/ensure-workspace.d.ts +2 -0
  121. package/dist/features/workspace-state/index.d.ts +27 -0
  122. package/dist/features/workspace-state/notepad-manager.d.ts +6 -0
  123. package/dist/features/workspace-state/plan-progress.d.ts +4 -0
  124. package/dist/features/workspace-state/review-dashboard.d.ts +11 -0
  125. package/dist/features/workspace-state/session-tracker.d.ts +8 -0
  126. package/dist/features/workspace-state/types.d.ts +38 -0
  127. package/dist/index.d.ts +3 -0
  128. package/dist/index.js +39359 -0
  129. package/dist/mcp/backlog-md.d.ts +2 -0
  130. package/dist/mcp/context7.d.ts +2 -0
  131. package/dist/mcp/contexthub.d.ts +2 -0
  132. package/dist/mcp/grep-app.d.ts +2 -0
  133. package/dist/mcp/index.d.ts +5 -0
  134. package/dist/mcp/types.d.ts +25 -0
  135. package/dist/mcp/websearch.d.ts +3 -0
  136. package/dist/plugin-config.d.ts +4 -0
  137. package/dist/plugin-handlers/config-handler.d.ts +10 -0
  138. package/dist/plugin-handlers/index.d.ts +3 -0
  139. package/dist/plugin-handlers/mcp-config-handler.d.ts +7 -0
  140. package/dist/plugin-interface.d.ts +18 -0
  141. package/dist/shared/deep-merge.d.ts +2 -0
  142. package/dist/shared/index.d.ts +3 -0
  143. package/dist/shared/logger.d.ts +2 -0
  144. package/dist/shared/path-helpers.d.ts +17 -0
  145. package/dist/types/agent.d.ts +12 -0
  146. package/dist/types/config.d.ts +39 -0
  147. package/dist/types/mcp.d.ts +11 -0
  148. package/dist/types/orchestrator.d.ts +30 -0
  149. package/dist/types/skill.d.ts +20 -0
  150. package/dist/types.d.ts +5 -0
  151. package/package.json +96 -0
  152. package/schemas/config.schema.json +189 -0
@@ -0,0 +1,17 @@
1
+ export type { BrowseConfig, CommandRequest, CommandResponse, HealthResponse, ServerState, } from './types.ts';
2
+ export { resolveConfig, getGitRoot, ensureBrowserStateDir, getRemoteSlug } from './config.ts';
3
+ export { CircularBuffer, consoleBuffer, networkBuffer, dialogBuffer, addConsoleEntry, addNetworkEntry, addDialogEntry, } from './buffers.ts';
4
+ export { BrowserManager } from './browser-manager.ts';
5
+ export { startServer } from './server.ts';
6
+ export { ALL_COMMANDS, READ_COMMANDS, WRITE_COMMANDS, META_COMMANDS, COMMAND_DESCRIPTIONS, } from './commands.ts';
7
+ export { IS_WINDOWS, TEMP_DIR, isPathWithin } from './platform.ts';
8
+ export { validateNavigationUrl } from './url-validation.ts';
9
+ export { handleSnapshot, parseSnapshotArgs, SNAPSHOT_FLAGS } from './snapshot.ts';
10
+ export { handleReadCommand, validateReadPath, getCleanText } from './read-commands.ts';
11
+ export { handleWriteCommand } from './write-commands.ts';
12
+ export { handleMetaCommand, validateOutputPath } from './meta-commands.ts';
13
+ export { findInstalledBrowsers, listDomains, importCookies, CookieImportError, } from './cookie-import-browser.ts';
14
+ export type { BrowserInfo, DomainEntry, ImportResult, PlaywrightCookie, } from './cookie-import-browser.ts';
15
+ export { handleCookiePickerRoute } from './cookie-picker-routes.ts';
16
+ export { getCookiePickerHTML } from './cookie-picker-ui.ts';
17
+ export { locateBinary } from './find-browse.ts';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Meta commands — tabs, server control, screenshots, chain, diff, snapshot
3
+ */
4
+ import type { BrowserManager } from './browser-manager.ts';
5
+ export declare function validateOutputPath(filePath: string): void;
6
+ export declare function handleMetaCommand(command: string, args: string[], bm: BrowserManager, shutdown: () => Promise<void> | void): Promise<string>;
@@ -0,0 +1,3 @@
1
+ export declare const IS_WINDOWS: boolean;
2
+ export declare const TEMP_DIR: string;
3
+ export declare function isPathWithin(resolvedPath: string, dir: string): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Read commands — extract data from pages without side effects
3
+ *
4
+ * text, html, links, forms, accessibility, js, eval, css, attrs,
5
+ * console, network, cookies, storage, perf
6
+ */
7
+ import type { BrowserManager } from './browser-manager.ts';
8
+ import type { Page } from 'playwright';
9
+ export declare function validateReadPath(filePath: string): void;
10
+ export declare function getCleanText(page: Page): Promise<string>;
11
+ export declare function handleReadCommand(command: string, args: string[], bm: BrowserManager): Promise<string>;
@@ -0,0 +1,27 @@
1
+ import type { BrowseConfig, ServerState } from './types.ts';
2
+ type BrowserManagerLike = {
3
+ serverPort: number;
4
+ launch: () => Promise<void>;
5
+ close: () => Promise<void>;
6
+ isHealthy: () => Promise<boolean>;
7
+ getTabCount: () => number;
8
+ getCurrentUrl: () => string;
9
+ resetFailures: () => void;
10
+ incrementFailures: () => void;
11
+ getFailureHint: () => string | null;
12
+ };
13
+ export type ServerRuntime = {
14
+ config: BrowseConfig;
15
+ token: string;
16
+ port: number;
17
+ state: ServerState;
18
+ shutdown: () => Promise<void>;
19
+ };
20
+ export type StartServerOptions = {
21
+ env?: Record<string, string | undefined>;
22
+ browserManager?: BrowserManagerLike;
23
+ skipBrowserLaunch?: boolean;
24
+ idleTimeoutMs?: number;
25
+ };
26
+ export declare function startServer(options?: StartServerOptions): Promise<ServerRuntime>;
27
+ export {};
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Snapshot command — accessibility tree with ref-based element selection
3
+ *
4
+ * Architecture (Locator map — no DOM mutation):
5
+ * 1. page.locator(scope).ariaSnapshot() → YAML-like accessibility tree
6
+ * 2. Parse tree, assign refs @e1, @e2, ...
7
+ * 3. Build Playwright Locator for each ref (getByRole + nth)
8
+ * 4. Store Map<string, Locator> on BrowserManager
9
+ * 5. Return compact text output with refs prepended
10
+ */
11
+ import type { BrowserManager } from './browser-manager.ts';
12
+ interface SnapshotOptions {
13
+ interactive?: boolean;
14
+ compact?: boolean;
15
+ depth?: number;
16
+ selector?: string;
17
+ diff?: boolean;
18
+ annotate?: boolean;
19
+ outputPath?: string;
20
+ cursorInteractive?: boolean;
21
+ }
22
+ /**
23
+ * Snapshot flag metadata — single source of truth for CLI parsing and doc generation.
24
+ * Imported by gen-skill-docs.ts and skill-parser.ts.
25
+ */
26
+ export declare const SNAPSHOT_FLAGS: Array<{
27
+ short: string;
28
+ long: string;
29
+ description: string;
30
+ takesValue?: boolean;
31
+ valueHint?: string;
32
+ optionKey: keyof SnapshotOptions;
33
+ }>;
34
+ export declare function parseSnapshotArgs(args: string[]): SnapshotOptions;
35
+ export declare function handleSnapshot(args: string[], bm: BrowserManager): Promise<string>;
36
+ export {};
@@ -0,0 +1,31 @@
1
+ export type BrowseConfig = {
2
+ projectDir: string;
3
+ stateDir: string;
4
+ stateFile: string;
5
+ consoleLog: string;
6
+ networkLog: string;
7
+ dialogLog: string;
8
+ };
9
+ export type ServerState = {
10
+ pid: number;
11
+ port: number;
12
+ token: string;
13
+ startedAt: string;
14
+ serverPath: string;
15
+ binaryVersion?: string;
16
+ };
17
+ export type HealthResponse = {
18
+ status: 'healthy' | 'unhealthy';
19
+ uptime: number;
20
+ pageCount: number;
21
+ };
22
+ export type CommandRequest = {
23
+ command: string;
24
+ args: string[];
25
+ };
26
+ export type CommandResponse = {
27
+ ok: boolean;
28
+ data?: string;
29
+ error?: string;
30
+ hint?: string;
31
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * URL validation for navigation commands — blocks dangerous schemes and cloud metadata endpoints.
3
+ * Localhost and private IPs are allowed (primary use case: QA testing local dev servers).
4
+ */
5
+ export declare function validateNavigationUrl(url: string): void;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Write commands — navigate and interact with pages (side effects)
3
+ *
4
+ * goto, back, forward, reload, click, fill, select, hover, type,
5
+ * press, scroll, wait, viewport, cookie, header, useragent
6
+ */
7
+ import type { BrowserManager } from './browser-manager.ts';
8
+ export declare function handleWriteCommand(command: string, args: string[], bm: BrowserManager): Promise<string>;
@@ -0,0 +1,3 @@
1
+ export * from './skills/index.ts';
2
+ export * from './types.ts';
3
+ export * from './skills.ts';
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const benchmarkSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const browseSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const canarySkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const carefulSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const codexSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const designConsultationSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const designReviewSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const documentReleaseSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const freezeSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const guardSkill: GstackSkill;
@@ -0,0 +1,25 @@
1
+ export { officeHoursSkill } from './office-hours.ts';
2
+ export { planCeoReviewSkill } from './plan-ceo-review.ts';
3
+ export { planEngReviewSkill } from './plan-eng-review.ts';
4
+ export { planDesignReviewSkill } from './plan-design-review.ts';
5
+ export { reviewSkill } from './review.ts';
6
+ export { designConsultationSkill } from './design-consultation.ts';
7
+ export { codexSkill } from './codex.ts';
8
+ export { carefulSkill } from './careful.ts';
9
+ export { freezeSkill } from './freeze.ts';
10
+ export { guardSkill } from './guard.ts';
11
+ export { unfreezeSkill } from './unfreeze.ts';
12
+ export { investigateSkill } from './investigate.ts';
13
+ export { retroSkill } from './retro.ts';
14
+ export { shipSkill } from './ship.ts';
15
+ export { landAndDeploySkill } from './land-and-deploy.ts';
16
+ export { setupDeploySkill } from './setup-deploy.ts';
17
+ export { documentReleaseSkill } from './document-release.ts';
18
+ export { browseSkill } from './browse.ts';
19
+ export { qaSkill } from './qa.ts';
20
+ export { qaOnlySkill } from './qa-only.ts';
21
+ export { designReviewSkill } from './design-review.ts';
22
+ export { benchmarkSkill } from './benchmark.ts';
23
+ export { canarySkill } from './canary.ts';
24
+ export { setupBrowserCookiesSkill } from './setup-browser-cookies.ts';
25
+ export { upgradeSkill } from './upgrade.ts';
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const investigateSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const landAndDeploySkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const officeHoursSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const planCeoReviewSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const planDesignReviewSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const planEngReviewSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const qaOnlySkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const qaSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const retroSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const reviewSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const setupBrowserCookiesSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const setupDeploySkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const shipSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const unfreezeSkill: GstackSkill;
@@ -0,0 +1,2 @@
1
+ import type { GstackSkill } from '../../../types/skill.ts';
2
+ export declare const upgradeSkill: GstackSkill;
@@ -0,0 +1,3 @@
1
+ import type { GstackSkill } from '../../types/skill.ts';
2
+ import type { CreateBuiltinSkillsOptions } from './types.ts';
3
+ export declare function createBuiltinSkills(options?: CreateBuiltinSkillsOptions): GstackSkill[];
@@ -0,0 +1,4 @@
1
+ export interface CreateBuiltinSkillsOptions {
2
+ disabledSkills?: Set<string>;
3
+ browserAvailable?: boolean;
4
+ }
@@ -0,0 +1,19 @@
1
+ import type { GstackAgent, SprintPhase } from '../../types/agent.ts';
2
+ import type { BuiltinSkill } from '../../types/skill.ts';
3
+ import type { OrchestrationMode } from '../../types/config.ts';
4
+ import type { ClassifiedIntent } from './types.ts';
5
+ export interface DelegationResult {
6
+ agent: GstackAgent;
7
+ skills: BuiltinSkill[];
8
+ phase: SprintPhase;
9
+ reasoning: string;
10
+ fallbackSkills?: BuiltinSkill[];
11
+ }
12
+ export interface DelegationOptions {
13
+ agents: GstackAgent[];
14
+ skills: BuiltinSkill[];
15
+ orchestrationMode: OrchestrationMode;
16
+ disabledAgents?: Set<string>;
17
+ }
18
+ export declare function getPhaseSkills(phase: SprintPhase, allSkills: BuiltinSkill[]): BuiltinSkill[];
19
+ export declare function delegateIntent(classified: ClassifiedIntent, options: DelegationOptions): DelegationResult | null;
@@ -0,0 +1,21 @@
1
+ import type { GstackAgent } from '../../types/agent.ts';
2
+ import type { BuiltinSkill } from '../../types/skill.ts';
3
+ import type { GstackConfig } from '../../types/config.ts';
4
+ import type { ClassifiedIntent } from './types.ts';
5
+ import type { DelegationResult } from './delegation-engine.ts';
6
+ export type { UserIntent, ClassifiedIntent, IntentClassifierOptions } from './types.ts';
7
+ export { PHASE_PATTERNS, SKILL_TO_PHASE_MAP, PHASE_TO_DEFAULT_AGENT } from './intent-patterns.ts';
8
+ export { classifyIntent, extractExplicitSkillName } from './intent-classifier.ts';
9
+ export type { DelegationResult, DelegationOptions } from './delegation-engine.ts';
10
+ export { delegateIntent, getPhaseSkills } from './delegation-engine.ts';
11
+ export interface OrchestratorOptions {
12
+ agents: GstackAgent[];
13
+ skills: BuiltinSkill[];
14
+ config: GstackConfig;
15
+ }
16
+ export interface Orchestrator {
17
+ classify(text: string): ClassifiedIntent;
18
+ delegate(classified: ClassifiedIntent): DelegationResult | null;
19
+ }
20
+ export declare function createOrchestrator(options: OrchestratorOptions): Orchestrator;
21
+ export type { SprintPhase } from '../../types/agent.ts';
@@ -0,0 +1,3 @@
1
+ import type { ClassifiedIntent, IntentClassifierOptions } from './types.ts';
2
+ export declare function extractExplicitSkillName(text: string): string | null;
3
+ export declare function classifyIntent(text: string, options: IntentClassifierOptions): ClassifiedIntent;
@@ -0,0 +1,4 @@
1
+ import type { AgentRole, SprintPhase } from '../../types/agent.ts';
2
+ export declare const PHASE_PATTERNS: Map<SprintPhase, RegExp[]>;
3
+ export declare const SKILL_TO_PHASE_MAP: Readonly<Record<string, SprintPhase>>;
4
+ export declare const PHASE_TO_DEFAULT_AGENT: Readonly<Record<SprintPhase, AgentRole>>;
@@ -0,0 +1,22 @@
1
+ import type { SprintPhase } from '../../types/agent.ts';
2
+ import type { AgentRole } from '../../types/agent.ts';
3
+ import type { OrchestrationMode } from '../../types/config.ts';
4
+ export interface UserIntent {
5
+ text: string;
6
+ context?: {
7
+ currentPhase?: SprintPhase;
8
+ recentSkills?: string[];
9
+ hasDesignDoc?: boolean;
10
+ hasBacklog?: boolean;
11
+ };
12
+ }
13
+ export interface ClassifiedIntent {
14
+ phase: SprintPhase;
15
+ confidence: number;
16
+ suggestedAgent: AgentRole;
17
+ suggestedSkills: string[];
18
+ reasoning: string;
19
+ }
20
+ export interface IntentClassifierOptions {
21
+ orchestrationMode: OrchestrationMode;
22
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Transforms raw gstack SKILL.md content for OpenCode compatibility.
3
+ * Removes Claude Code / gstack binary references and adapts paths.
4
+ */
5
+ /**
6
+ * Transforms raw gstack SKILL.md content to be OpenCode-compatible.
7
+ * Replaces binary references, absolute paths, and Claude Code-specific hooks.
8
+ *
9
+ * @param rawContent - Raw SKILL.md content from gstack
10
+ * @returns Transformed content safe for use in OpenCode
11
+ */
12
+ export declare function transformSkillContent(rawContent: string): string;
@@ -0,0 +1,4 @@
1
+ export { resolveTemplate, GSTACK_PLACEHOLDER_NAMES } from './template-resolver.ts';
2
+ export type { GstackPlaceholderName } from './template-resolver.ts';
3
+ export { transformSkillContent } from './content-transformer.ts';
4
+ export { DEFAULT_PLACEHOLDERS } from './placeholder-content.ts';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * OpenCode-adapted placeholder content for gstack skill templates.
3
+ * These replace the 9 gstack template placeholders originally resolved by gen-skill-docs.ts.
4
+ */
5
+ export declare const DEFAULT_PLACEHOLDERS: Record<string, string>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Resolves {{PLACEHOLDER_NAME}} patterns in gstack skill template content.
3
+ * Unknown placeholders are left as-is (no error thrown).
4
+ *
5
+ * @param templateContent - Raw template string with {{PLACEHOLDER}} patterns
6
+ * @param placeholders - Map of placeholder name to replacement content
7
+ * @returns Resolved content with placeholders replaced
8
+ */
9
+ export declare function resolveTemplate(templateContent: string, placeholders?: Record<string, string>): string;
10
+ /**
11
+ * The 9 standard gstack placeholder names.
12
+ */
13
+ export declare const GSTACK_PLACEHOLDER_NAMES: readonly ["PREAMBLE", "COMMAND_REFERENCE", "SNAPSHOT_FLAGS", "BROWSE_SETUP", "BASE_BRANCH_DETECT", "QA_METHODOLOGY", "DESIGN_METHODOLOGY", "REVIEW_DASHBOARD", "TEST_BOOTSTRAP"];
14
+ export type GstackPlaceholderName = (typeof GSTACK_PLACEHOLDER_NAMES)[number];
@@ -0,0 +1,4 @@
1
+ import type { SkillMcpManagerState } from './types.ts';
2
+ export declare function disconnectSession(state: SkillMcpManagerState, sessionID: string): Promise<void>;
3
+ export declare function disconnectAll(state: SkillMcpManagerState): Promise<void>;
4
+ export declare function forceReconnect(state: SkillMcpManagerState, clientKey: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
2
+ import type { SkillMcpClientConnectionParams } from './types.ts';
3
+ export declare function getOrCreateClient(params: SkillMcpClientConnectionParams): Promise<Client>;
4
+ export declare function getOrCreateClientWithRetryImpl(params: SkillMcpClientConnectionParams): Promise<Client>;
@@ -0,0 +1,2 @@
1
+ export type { McpToolInvoker, SkillMcpClientInfo, SkillMcpManagerState, SkillMcpServerContext, ManagedClient, } from './types.ts';
2
+ export { SkillMcpManager } from './manager.ts';
@@ -0,0 +1,19 @@
1
+ import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
2
+ import type { Resource, Tool } from '@modelcontextprotocol/sdk/types.js';
3
+ import type { SkillMcpClientInfo, SkillMcpServerContext } from './types.ts';
4
+ import type { McpServerConfig } from '../../types/mcp.ts';
5
+ export declare class SkillMcpManager {
6
+ private readonly state;
7
+ private getClientKey;
8
+ getOrCreateClient(info: SkillMcpClientInfo, config: McpServerConfig): Promise<Client>;
9
+ disconnectSession(sessionID: string): Promise<void>;
10
+ disconnectAll(): Promise<void>;
11
+ listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
12
+ listResources(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Resource[]>;
13
+ callTool(info: SkillMcpClientInfo, context: SkillMcpServerContext, name: string, args: Record<string, unknown>): Promise<unknown>;
14
+ readResource(info: SkillMcpClientInfo, context: SkillMcpServerContext, uri: string): Promise<unknown>;
15
+ private withOperationRetry;
16
+ private getOrCreateClientWithRetry;
17
+ getConnectedServers(): string[];
18
+ isConnected(info: SkillMcpClientInfo): boolean;
19
+ }
@@ -0,0 +1,33 @@
1
+ import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
2
+ import type { McpServerConfig } from '../../types/mcp.ts';
3
+ export interface SkillMcpClientInfo {
4
+ serverName: string;
5
+ skillName: string;
6
+ sessionID: string;
7
+ }
8
+ export interface SkillMcpServerContext {
9
+ config: McpServerConfig;
10
+ skillName: string;
11
+ }
12
+ export interface ManagedClient {
13
+ client: Client;
14
+ skillName: string;
15
+ lastUsedAt: number;
16
+ connectionType: 'stdio' | 'remote';
17
+ }
18
+ export interface SkillMcpManagerState {
19
+ clients: Map<string, Client>;
20
+ pendingConnections: Map<string, Promise<Client>>;
21
+ disconnectedSessions: Map<string, number>;
22
+ idleTimeoutMs: number;
23
+ disposed: boolean;
24
+ }
25
+ export interface SkillMcpClientConnectionParams {
26
+ state: SkillMcpManagerState;
27
+ clientKey: string;
28
+ info: SkillMcpClientInfo;
29
+ config: McpServerConfig;
30
+ }
31
+ export interface McpToolInvoker {
32
+ invoke(serverName: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
33
+ }
@@ -0,0 +1,18 @@
1
+ import type { McpToolInvoker } from '../skill-mcp-manager/index.ts';
2
+ import type { BacklogMcpAvailability, BacklogTask, BacklogTaskStatus } from './types.ts';
3
+ interface CreateTaskOptions {
4
+ priority?: BacklogTask['priority'];
5
+ assignee?: string;
6
+ dependencies?: string[];
7
+ definitionOfDone?: string[];
8
+ implementationPlan?: string;
9
+ }
10
+ export interface BacklogClient {
11
+ isAvailable(): Promise<BacklogMcpAvailability>;
12
+ createTask(_title: string, _opts?: CreateTaskOptions): Promise<BacklogTask | null>;
13
+ updateStatus(_taskId: string, _status: BacklogTaskStatus): Promise<boolean>;
14
+ listTasks(_filter?: Record<string, unknown>): Promise<BacklogTask[]>;
15
+ archiveTask(_taskId: string): Promise<boolean>;
16
+ }
17
+ export declare function createBacklogClient(mcpTools: McpToolInvoker): BacklogClient;
18
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { AgentRole } from '../../types/agent.ts';
2
+ import type { BacklogClient } from './backlog-client.ts';
3
+ export interface BuildStatusUpdater {
4
+ markInProgress(taskId: string, agent: AgentRole): Promise<void>;
5
+ markDone(taskId: string, agent: AgentRole): Promise<void>;
6
+ recordBlocker(taskId: string, reason: string): Promise<void>;
7
+ }
8
+ export declare function createBuildStatusUpdater(client: BacklogClient): BuildStatusUpdater;
@@ -0,0 +1 @@
1
+ export declare function withBacklogFallback<T>(operation: () => Promise<T>, fallback: T, context: string): Promise<T>;
@@ -0,0 +1,21 @@
1
+ import type { McpToolInvoker } from '../skill-mcp-manager/index.ts';
2
+ import type { BacklogClient } from './backlog-client.ts';
3
+ import type { ThinkPlanTaskCreator } from './think-plan-creator.ts';
4
+ import type { BuildStatusUpdater } from './build-status-updater.ts';
5
+ import type { ShipReadinessChecker } from './ship-readiness-checker.ts';
6
+ import type { BacklogMcpAvailability } from './types.ts';
7
+ export type { BacklogTask, SprintContext, BacklogMcpAvailability } from './types.ts';
8
+ export type { BacklogClient } from './backlog-client.ts';
9
+ export { createBacklogClient } from './backlog-client.ts';
10
+ export { createThinkPlanTaskCreator } from './think-plan-creator.ts';
11
+ export { createBuildStatusUpdater } from './build-status-updater.ts';
12
+ export { createShipReadinessChecker } from './ship-readiness-checker.ts';
13
+ export { withBacklogFallback } from './graceful-degradation.ts';
14
+ export interface SprintBacklog {
15
+ client: BacklogClient;
16
+ taskCreator: ThinkPlanTaskCreator;
17
+ statusUpdater: BuildStatusUpdater;
18
+ shipChecker: ShipReadinessChecker;
19
+ isAvailable(): Promise<BacklogMcpAvailability>;
20
+ }
21
+ export declare function createSprintBacklog(mcpTools: McpToolInvoker): SprintBacklog;
@@ -0,0 +1,10 @@
1
+ import type { BacklogClient } from './backlog-client.ts';
2
+ import type { BacklogTask } from './types.ts';
3
+ export interface ShipReadinessChecker {
4
+ check(): Promise<{
5
+ ready: boolean;
6
+ pendingTasks: BacklogTask[];
7
+ completionPercentage: number;
8
+ }>;
9
+ }
10
+ export declare function createShipReadinessChecker(client: BacklogClient): ShipReadinessChecker;
@@ -0,0 +1,6 @@
1
+ import type { BacklogClient } from './backlog-client.ts';
2
+ import type { BacklogTask } from './types.ts';
3
+ export interface ThinkPlanTaskCreator {
4
+ createSprintTasks(planName: string, objectives: string[]): Promise<BacklogTask[]>;
5
+ }
6
+ export declare function createThinkPlanTaskCreator(client: BacklogClient): ThinkPlanTaskCreator;
@@ -0,0 +1,23 @@
1
+ import type { SprintPhase } from '../../types/agent.ts';
2
+ export type BacklogTaskStatus = 'todo' | 'in-progress' | 'done' | 'archived';
3
+ export type BacklogTaskPriority = 'p0' | 'p1' | 'p2';
4
+ export interface BacklogTask {
5
+ id: string;
6
+ title: string;
7
+ status: BacklogTaskStatus;
8
+ priority: BacklogTaskPriority;
9
+ assignee?: string;
10
+ dependencies?: string[];
11
+ definitionOfDone?: string[];
12
+ implementationPlan?: string;
13
+ }
14
+ export interface SprintContext {
15
+ sprintId: string;
16
+ phase: SprintPhase;
17
+ activeTasks: BacklogTask[];
18
+ completedTasks: BacklogTask[];
19
+ }
20
+ export interface BacklogMcpAvailability {
21
+ available: boolean;
22
+ reason?: string;
23
+ }
@@ -0,0 +1,16 @@
1
+ import type { BoulderState } from './types.ts';
2
+ export interface UpsertTaskSessionInput {
3
+ taskKey: string;
4
+ taskLabel: string;
5
+ taskTitle: string;
6
+ sessionId: string;
7
+ agent?: string;
8
+ category?: string;
9
+ }
10
+ export declare function getBoulderFilePath(directory: string): string;
11
+ export declare function readBoulderState(directory: string): BoulderState | null;
12
+ export declare function writeBoulderState(directory: string, state: BoulderState): boolean;
13
+ export declare function appendSessionId(directory: string, sessionId: string): BoulderState | null;
14
+ export declare function clearBoulderState(directory: string): boolean;
15
+ export declare function createBoulderState(planPath: string, sessionId: string, agent?: string): BoulderState;
16
+ export declare function upsertTaskSessionState(directory: string, input: UpsertTaskSessionInput): BoulderState | null;