@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,2 @@
1
+ import type { GstackConfig } from '../types/config.ts';
2
+ export declare function mergeConfigs(base: GstackConfig, override: Partial<GstackConfig>): GstackConfig;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentOverrideSchema: z.ZodObject<{
3
+ model: z.ZodOptional<z.ZodString>;
4
+ instructions: z.ZodOptional<z.ZodString>;
5
+ enabled: z.ZodOptional<z.ZodBoolean>;
6
+ }, z.core.$strip>;
7
+ export declare const AgentOverridesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
8
+ model: z.ZodOptional<z.ZodString>;
9
+ instructions: z.ZodOptional<z.ZodString>;
10
+ enabled: z.ZodOptional<z.ZodBoolean>;
11
+ }, z.core.$strip>>;
12
+ export type AgentOverride = z.infer<typeof AgentOverrideSchema>;
13
+ export type AgentOverrides = z.infer<typeof AgentOverridesSchema>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const BacklogConfigSchema: z.ZodObject<{
3
+ enabled: z.ZodDefault<z.ZodBoolean>;
4
+ auto_create_tasks: z.ZodDefault<z.ZodBoolean>;
5
+ auto_update_status: z.ZodDefault<z.ZodBoolean>;
6
+ }, z.core.$strip>;
7
+ export type BacklogConfig = z.infer<typeof BacklogConfigSchema>;
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export declare const BrowserConfigSchema: z.ZodObject<{
3
+ headless: z.ZodDefault<z.ZodBoolean>;
4
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
5
+ }, z.core.$strip>;
6
+ export type BrowserConfig = z.infer<typeof BrowserConfigSchema>;
@@ -0,0 +1 @@
1
+ export declare const SCHEMA_URL = "https://raw.githubusercontent.com/nntoan/opencode-gstack/main/schemas/config.schema.json";
@@ -0,0 +1,7 @@
1
+ export { AgentOverrideSchema, AgentOverridesSchema, type AgentOverride, type AgentOverrides, } from './agent-schema.ts';
2
+ export { WebsearchMcpSchema, Context7McpSchema, ContexthubMcpSchema, GrepAppMcpSchema, BacklogMdMcpSchema, McpConfigSchema, type WebsearchMcpConfig, type Context7McpConfig, type ContexthubMcpConfig, type GrepAppMcpConfig, type BacklogMdMcpConfig, type McpConfig, } from './mcp-schema.ts';
3
+ export { BacklogConfigSchema, type BacklogConfig } from './backlog-schema.ts';
4
+ export { BrowserConfigSchema, type BrowserConfig } from './browser-schema.ts';
5
+ export { TelemetryConfigSchema, type TelemetryConfig } from './telemetry-schema.ts';
6
+ export { GstackConfigSchema, type GstackConfigOutput } from './main.ts';
7
+ export { SCHEMA_URL } from './constants.ts';
@@ -0,0 +1,150 @@
1
+ import { z } from 'zod';
2
+ export declare const GstackConfigSchema: z.ZodPipe<z.ZodObject<{
3
+ orchestration_mode: z.ZodDefault<z.ZodEnum<{
4
+ "multi-agent": "multi-agent";
5
+ "skills-only": "skills-only";
6
+ }>>;
7
+ disabled_skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ disabled_agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ disabled_mcps: z.ZodDefault<z.ZodArray<z.ZodString>>;
10
+ disabled_hooks: z.ZodDefault<z.ZodArray<z.ZodString>>;
11
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
12
+ model: z.ZodOptional<z.ZodString>;
13
+ instructions: z.ZodOptional<z.ZodString>;
14
+ enabled: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$strip>>>;
16
+ mcp: z.ZodOptional<z.ZodObject<{
17
+ websearch: z.ZodOptional<z.ZodObject<{
18
+ provider: z.ZodDefault<z.ZodEnum<{
19
+ exa: "exa";
20
+ tavily: "tavily";
21
+ }>>;
22
+ api_key: z.ZodOptional<z.ZodString>;
23
+ enabled: z.ZodDefault<z.ZodBoolean>;
24
+ }, z.core.$strip>>;
25
+ context7: z.ZodOptional<z.ZodObject<{
26
+ api_key: z.ZodOptional<z.ZodString>;
27
+ enabled: z.ZodDefault<z.ZodBoolean>;
28
+ }, z.core.$strip>>;
29
+ contexthub: z.ZodOptional<z.ZodObject<{
30
+ enabled: z.ZodDefault<z.ZodBoolean>;
31
+ }, z.core.$strip>>;
32
+ grep_app: z.ZodOptional<z.ZodObject<{
33
+ enabled: z.ZodDefault<z.ZodBoolean>;
34
+ }, z.core.$strip>>;
35
+ backlog_md: z.ZodOptional<z.ZodObject<{
36
+ enabled: z.ZodDefault<z.ZodBoolean>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>>;
39
+ backlog: z.ZodOptional<z.ZodObject<{
40
+ enabled: z.ZodDefault<z.ZodBoolean>;
41
+ auto_create_tasks: z.ZodDefault<z.ZodBoolean>;
42
+ auto_update_status: z.ZodDefault<z.ZodBoolean>;
43
+ }, z.core.$strip>>;
44
+ browser: z.ZodOptional<z.ZodObject<{
45
+ headless: z.ZodDefault<z.ZodBoolean>;
46
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
47
+ }, z.core.$strip>>;
48
+ telemetry: z.ZodOptional<z.ZodObject<{
49
+ enabled: z.ZodDefault<z.ZodBoolean>;
50
+ supabase: z.ZodOptional<z.ZodObject<{
51
+ url: z.ZodOptional<z.ZodString>;
52
+ key: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>, z.ZodTransform<{
56
+ backlog: {
57
+ enabled: boolean;
58
+ auto_create_tasks: boolean;
59
+ auto_update_status: boolean;
60
+ };
61
+ orchestration_mode: "multi-agent" | "skills-only";
62
+ disabled_skills: string[];
63
+ disabled_agents: string[];
64
+ disabled_mcps: string[];
65
+ disabled_hooks: string[];
66
+ agents?: Record<string, {
67
+ model?: string | undefined;
68
+ instructions?: string | undefined;
69
+ enabled?: boolean | undefined;
70
+ }> | undefined;
71
+ mcp?: {
72
+ websearch?: {
73
+ provider: "exa" | "tavily";
74
+ enabled: boolean;
75
+ api_key?: string | undefined;
76
+ } | undefined;
77
+ context7?: {
78
+ enabled: boolean;
79
+ api_key?: string | undefined;
80
+ } | undefined;
81
+ contexthub?: {
82
+ enabled: boolean;
83
+ } | undefined;
84
+ grep_app?: {
85
+ enabled: boolean;
86
+ } | undefined;
87
+ backlog_md?: {
88
+ enabled: boolean;
89
+ } | undefined;
90
+ } | undefined;
91
+ browser?: {
92
+ headless: boolean;
93
+ timeout_ms: number;
94
+ } | undefined;
95
+ telemetry?: {
96
+ enabled: boolean;
97
+ supabase?: {
98
+ url?: string | undefined;
99
+ key?: string | undefined;
100
+ } | undefined;
101
+ } | undefined;
102
+ }, {
103
+ orchestration_mode: "multi-agent" | "skills-only";
104
+ disabled_skills: string[];
105
+ disabled_agents: string[];
106
+ disabled_mcps: string[];
107
+ disabled_hooks: string[];
108
+ agents?: Record<string, {
109
+ model?: string | undefined;
110
+ instructions?: string | undefined;
111
+ enabled?: boolean | undefined;
112
+ }> | undefined;
113
+ mcp?: {
114
+ websearch?: {
115
+ provider: "exa" | "tavily";
116
+ enabled: boolean;
117
+ api_key?: string | undefined;
118
+ } | undefined;
119
+ context7?: {
120
+ enabled: boolean;
121
+ api_key?: string | undefined;
122
+ } | undefined;
123
+ contexthub?: {
124
+ enabled: boolean;
125
+ } | undefined;
126
+ grep_app?: {
127
+ enabled: boolean;
128
+ } | undefined;
129
+ backlog_md?: {
130
+ enabled: boolean;
131
+ } | undefined;
132
+ } | undefined;
133
+ backlog?: {
134
+ enabled: boolean;
135
+ auto_create_tasks: boolean;
136
+ auto_update_status: boolean;
137
+ } | undefined;
138
+ browser?: {
139
+ headless: boolean;
140
+ timeout_ms: number;
141
+ } | undefined;
142
+ telemetry?: {
143
+ enabled: boolean;
144
+ supabase?: {
145
+ url?: string | undefined;
146
+ key?: string | undefined;
147
+ } | undefined;
148
+ } | undefined;
149
+ }>>;
150
+ export type GstackConfigOutput = z.infer<typeof GstackConfigSchema>;
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ export declare const WebsearchMcpSchema: z.ZodObject<{
3
+ provider: z.ZodDefault<z.ZodEnum<{
4
+ exa: "exa";
5
+ tavily: "tavily";
6
+ }>>;
7
+ api_key: z.ZodOptional<z.ZodString>;
8
+ enabled: z.ZodDefault<z.ZodBoolean>;
9
+ }, z.core.$strip>;
10
+ export declare const Context7McpSchema: z.ZodObject<{
11
+ api_key: z.ZodOptional<z.ZodString>;
12
+ enabled: z.ZodDefault<z.ZodBoolean>;
13
+ }, z.core.$strip>;
14
+ export declare const ContexthubMcpSchema: z.ZodObject<{
15
+ enabled: z.ZodDefault<z.ZodBoolean>;
16
+ }, z.core.$strip>;
17
+ export declare const GrepAppMcpSchema: z.ZodObject<{
18
+ enabled: z.ZodDefault<z.ZodBoolean>;
19
+ }, z.core.$strip>;
20
+ export declare const BacklogMdMcpSchema: z.ZodObject<{
21
+ enabled: z.ZodDefault<z.ZodBoolean>;
22
+ }, z.core.$strip>;
23
+ export declare const McpConfigSchema: z.ZodObject<{
24
+ websearch: z.ZodOptional<z.ZodObject<{
25
+ provider: z.ZodDefault<z.ZodEnum<{
26
+ exa: "exa";
27
+ tavily: "tavily";
28
+ }>>;
29
+ api_key: z.ZodOptional<z.ZodString>;
30
+ enabled: z.ZodDefault<z.ZodBoolean>;
31
+ }, z.core.$strip>>;
32
+ context7: z.ZodOptional<z.ZodObject<{
33
+ api_key: z.ZodOptional<z.ZodString>;
34
+ enabled: z.ZodDefault<z.ZodBoolean>;
35
+ }, z.core.$strip>>;
36
+ contexthub: z.ZodOptional<z.ZodObject<{
37
+ enabled: z.ZodDefault<z.ZodBoolean>;
38
+ }, z.core.$strip>>;
39
+ grep_app: z.ZodOptional<z.ZodObject<{
40
+ enabled: z.ZodDefault<z.ZodBoolean>;
41
+ }, z.core.$strip>>;
42
+ backlog_md: z.ZodOptional<z.ZodObject<{
43
+ enabled: z.ZodDefault<z.ZodBoolean>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
46
+ export type WebsearchMcpConfig = z.infer<typeof WebsearchMcpSchema>;
47
+ export type Context7McpConfig = z.infer<typeof Context7McpSchema>;
48
+ export type ContexthubMcpConfig = z.infer<typeof ContexthubMcpSchema>;
49
+ export type GrepAppMcpConfig = z.infer<typeof GrepAppMcpSchema>;
50
+ export type BacklogMdMcpConfig = z.infer<typeof BacklogMdMcpSchema>;
51
+ export type McpConfig = z.infer<typeof McpConfigSchema>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare const TelemetryConfigSchema: z.ZodObject<{
3
+ enabled: z.ZodDefault<z.ZodBoolean>;
4
+ supabase: z.ZodOptional<z.ZodObject<{
5
+ url: z.ZodOptional<z.ZodString>;
6
+ key: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>>;
8
+ }, z.core.$strip>;
9
+ export type TelemetryConfig = z.infer<typeof TelemetryConfigSchema>;
@@ -0,0 +1,9 @@
1
+ import type { GstackConfig } from './types/config.ts';
2
+ import type { Managers } from './create-managers.ts';
3
+ export declare function createHooks(_params: {
4
+ ctx: {
5
+ directory: string;
6
+ };
7
+ pluginConfig: GstackConfig;
8
+ managers: Managers;
9
+ }): Record<string, unknown>;
@@ -0,0 +1,17 @@
1
+ import type { GstackConfig } from './types/config.ts';
2
+ import type { GstackSkill } from './types/skill.ts';
3
+ import { SkillMcpManager } from './features/skill-mcp-manager/index.ts';
4
+ import { createConfigHandler } from './plugin-handlers/index.ts';
5
+ import type { SprintBacklog } from './features/sprint-backlog/index.ts';
6
+ export interface Managers {
7
+ skillMcpManager: SkillMcpManager;
8
+ configHandler: ReturnType<typeof createConfigHandler>;
9
+ sprintBacklog: SprintBacklog;
10
+ }
11
+ export declare function createManagers(params: {
12
+ ctx: {
13
+ directory: string;
14
+ };
15
+ pluginConfig: GstackConfig;
16
+ skills?: GstackSkill[];
17
+ }): Managers;
@@ -0,0 +1,8 @@
1
+ import type { GstackConfig } from './types/config.ts';
2
+ import type { GstackSkill } from './types/skill.ts';
3
+ import type { GstackAgent } from './types/agent.ts';
4
+ export interface SkillsAndAgents {
5
+ skills: GstackSkill[];
6
+ agents: GstackAgent[];
7
+ }
8
+ export declare function createSkillsAndAgents(config: GstackConfig): SkillsAndAgents;
@@ -0,0 +1,9 @@
1
+ import type { GstackConfig } from './types/config.ts';
2
+ import type { Managers } from './create-managers.ts';
3
+ export declare function createTools(_params: {
4
+ ctx: {
5
+ directory: string;
6
+ };
7
+ pluginConfig: GstackConfig;
8
+ managers: Managers;
9
+ }): Record<string, unknown>;
@@ -0,0 +1,2 @@
1
+ import type { AnalyticsOptions, EurekaTracker } from './types.ts';
2
+ export declare function createEurekaTracker(options: AnalyticsOptions): EurekaTracker;
@@ -0,0 +1,12 @@
1
+ export type { AnalyticsOptions, EurekaEvent, EurekaTracker, SkillUsageEvent, SkillUsageTracker, SprintLogEvent, SprintLogger, } from './types.ts';
2
+ export { appendJsonl, readJsonl } from './writer.ts';
3
+ export { createEurekaTracker } from './eureka-tracker.ts';
4
+ export { createSkillUsageTracker } from './skill-usage-tracker.ts';
5
+ export { createSprintLogger } from './sprint-logger.ts';
6
+ import type { AnalyticsOptions, EurekaTracker, SkillUsageTracker, SprintLogger } from './types.ts';
7
+ export interface Analytics {
8
+ skillUsage: SkillUsageTracker;
9
+ eureka: EurekaTracker;
10
+ sprintLog: SprintLogger;
11
+ }
12
+ export declare function createAnalytics(options: AnalyticsOptions): Analytics;
@@ -0,0 +1,2 @@
1
+ import type { AnalyticsOptions, SkillUsageTracker } from './types.ts';
2
+ export declare function createSkillUsageTracker(options: AnalyticsOptions): SkillUsageTracker;
@@ -0,0 +1,2 @@
1
+ import type { AnalyticsOptions, SprintLogger } from './types.ts';
2
+ export declare function createSprintLogger(options: AnalyticsOptions): SprintLogger;
@@ -0,0 +1,38 @@
1
+ import type { SprintPhase } from '../../types/agent.ts';
2
+ export interface SkillUsageEvent {
3
+ timestamp: string;
4
+ skillName: string;
5
+ duration: number;
6
+ success: boolean;
7
+ phase?: SprintPhase;
8
+ version: string;
9
+ }
10
+ export interface EurekaEvent {
11
+ timestamp: string;
12
+ skillName: string;
13
+ insight: string;
14
+ category: 'learning' | 'bug' | 'optimization' | 'pattern';
15
+ }
16
+ export interface SprintLogEvent {
17
+ timestamp: string;
18
+ phase: SprintPhase;
19
+ action: 'started' | 'completed' | 'skipped';
20
+ agent?: string;
21
+ taskId?: string;
22
+ }
23
+ export interface AnalyticsOptions {
24
+ analyticsDir: string;
25
+ enabled: boolean;
26
+ }
27
+ export interface SkillUsageTracker {
28
+ record(event: SkillUsageEvent): void;
29
+ getRecent(limit: number): SkillUsageEvent[];
30
+ }
31
+ export interface EurekaTracker {
32
+ record(event: EurekaEvent): void;
33
+ getInsights(skillName?: string): EurekaEvent[];
34
+ }
35
+ export interface SprintLogger {
36
+ log(event: SprintLogEvent): void;
37
+ getPhaseHistory(): SprintLogEvent[];
38
+ }
@@ -0,0 +1,2 @@
1
+ export declare function appendJsonl(filePath: string, event: Record<string, unknown>): Promise<void>;
2
+ export declare function readJsonl<T>(filePath: string): T[];
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Browser lifecycle manager
3
+ *
4
+ * Chromium crash handling:
5
+ * browser.on('disconnected') → log error → process.exit(1)
6
+ * CLI detects dead server → auto-restarts on next command
7
+ * We do NOT try to self-heal — don't hide failure.
8
+ *
9
+ * Dialog handling:
10
+ * page.on('dialog') → auto-accept by default → store in dialog buffer
11
+ * Prevents browser lockup from alert/confirm/prompt
12
+ *
13
+ * Context recreation (useragent):
14
+ * recreateContext() saves cookies/storage/URLs, creates new context,
15
+ * restores state. Falls back to clean slate on any failure.
16
+ */
17
+ import { type Cookie, type Locator, type Page } from 'playwright';
18
+ export interface RefEntry {
19
+ locator: Locator;
20
+ role: string;
21
+ name: string;
22
+ }
23
+ export interface BrowserState {
24
+ cookies: Cookie[];
25
+ pages: Array<{
26
+ url: string;
27
+ isActive: boolean;
28
+ storage: {
29
+ localStorage: Record<string, string>;
30
+ sessionStorage: Record<string, string>;
31
+ } | null;
32
+ }>;
33
+ }
34
+ export declare class BrowserManager {
35
+ private browser;
36
+ private context;
37
+ private pages;
38
+ private activeTabId;
39
+ private nextTabId;
40
+ private extraHeaders;
41
+ private customUserAgent;
42
+ /** Server port — set after server starts, used by cookie-import-browser command */
43
+ serverPort: number;
44
+ private refMap;
45
+ private lastSnapshot;
46
+ private dialogAutoAccept;
47
+ private dialogPromptText;
48
+ private isHeaded;
49
+ private consecutiveFailures;
50
+ launch(): Promise<void>;
51
+ close(): Promise<void>;
52
+ isHealthy(): Promise<boolean>;
53
+ newTab(url?: string): Promise<number>;
54
+ closeTab(id?: number): Promise<void>;
55
+ switchTab(id: number): void;
56
+ getTabCount(): number;
57
+ getTabListWithTitles(): Promise<Array<{
58
+ id: number;
59
+ url: string;
60
+ title: string;
61
+ active: boolean;
62
+ }>>;
63
+ getPage(): Page;
64
+ getCurrentUrl(): string;
65
+ setRefMap(refs: Map<string, RefEntry>): void;
66
+ clearRefs(): void;
67
+ /**
68
+ * Resolve a selector that may be a @ref (e.g., "@e3", "@c1") or a CSS selector.
69
+ * Returns { locator } for refs or { selector } for CSS selectors.
70
+ */
71
+ resolveRef(selector: string): Promise<{
72
+ locator: Locator;
73
+ } | {
74
+ selector: string;
75
+ }>;
76
+ /** Get the ARIA role for a ref selector, or null for CSS selectors / unknown refs. */
77
+ getRefRole(selector: string): string | null;
78
+ getRefCount(): number;
79
+ setLastSnapshot(text: string | null): void;
80
+ getLastSnapshot(): string | null;
81
+ setDialogAutoAccept(accept: boolean): void;
82
+ getDialogAutoAccept(): boolean;
83
+ setDialogPromptText(text: string | null): void;
84
+ getDialogPromptText(): string | null;
85
+ setViewport(width: number, height: number): Promise<void>;
86
+ setExtraHeader(name: string, value: string): Promise<void>;
87
+ setUserAgent(ua: string): void;
88
+ getUserAgent(): string | null;
89
+ saveState(): Promise<BrowserState>;
90
+ restoreState(state: BrowserState): Promise<void>;
91
+ recreateContext(): Promise<string | null>;
92
+ handoff(message: string): Promise<string>;
93
+ resume(): void;
94
+ getIsHeaded(): boolean;
95
+ incrementFailures(): void;
96
+ resetFailures(): void;
97
+ getFailureHint(): string | null;
98
+ private wirePageEvents;
99
+ }
@@ -0,0 +1,43 @@
1
+ export declare class CircularBuffer<T> {
2
+ private buffer;
3
+ private head;
4
+ private _size;
5
+ private _totalAdded;
6
+ readonly capacity: number;
7
+ constructor(capacity: number);
8
+ push(entry: T): void;
9
+ toArray(): T[];
10
+ last(n: number): T[];
11
+ get length(): number;
12
+ get totalAdded(): number;
13
+ clear(): void;
14
+ get(index: number): T | undefined;
15
+ set(index: number, entry: T): void;
16
+ }
17
+ export interface LogEntry {
18
+ timestamp: number;
19
+ level: string;
20
+ text: string;
21
+ }
22
+ export interface NetworkEntry {
23
+ timestamp: number;
24
+ method: string;
25
+ url: string;
26
+ status?: number;
27
+ duration?: number;
28
+ size?: number;
29
+ }
30
+ export interface DialogEntry {
31
+ timestamp: number;
32
+ type: string;
33
+ message: string;
34
+ defaultValue?: string;
35
+ action: string;
36
+ response?: string;
37
+ }
38
+ export declare const consoleBuffer: CircularBuffer<LogEntry>;
39
+ export declare const networkBuffer: CircularBuffer<NetworkEntry>;
40
+ export declare const dialogBuffer: CircularBuffer<DialogEntry>;
41
+ export declare function addConsoleEntry(entry: LogEntry): void;
42
+ export declare function addNetworkEntry(entry: NetworkEntry): void;
43
+ export declare function addDialogEntry(entry: DialogEntry): void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * gstack browse CLI — thin wrapper that talks to the persistent server
3
+ *
4
+ * Flow:
5
+ * 1. Read .gstack/browser/browse.json for port + token
6
+ * 2. If missing or stale PID → start server in background
7
+ * 3. Health check + version mismatch detection
8
+ * 4. Send command via HTTP POST
9
+ * 5. Print response to stdout (or stderr for errors)
10
+ */
11
+ export declare function resolveServerScript(env?: Record<string, string | undefined>, metaDir?: string, execPath?: string): string;
12
+ export declare function resolveNodeServerScript(metaDir?: string, execPath?: string): string | null;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Command registry — single source of truth for all browse commands.
3
+ * Zero side effects. Safe to import from build scripts and tests.
4
+ */
5
+ export declare const READ_COMMANDS: Set<string>;
6
+ export declare const WRITE_COMMANDS: Set<string>;
7
+ export declare const META_COMMANDS: Set<string>;
8
+ export declare const ALL_COMMANDS: Set<string>;
9
+ export declare const COMMAND_DESCRIPTIONS: Record<string, {
10
+ category: string;
11
+ description: string;
12
+ usage?: string;
13
+ }>;
@@ -0,0 +1,6 @@
1
+ import type { BrowseConfig } from './types.ts';
2
+ export declare function getGitRoot(): string | null;
3
+ export declare function resolveConfig(env?: Record<string, string | undefined>): BrowseConfig;
4
+ export declare function ensureBrowserStateDir(config: BrowseConfig): void;
5
+ export declare function getRemoteSlug(): string;
6
+ export declare function readVersionHash(execPath?: string): string | null;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Chromium browser cookie import — read and decrypt cookies from real browsers
3
+ *
4
+ * Supports macOS Chromium-based browsers: Comet, Chrome, Arc, Brave, Edge.
5
+ * Pure logic module — no Playwright dependency, no HTTP concerns.
6
+ *
7
+ * Decryption pipeline (Chromium macOS "v10" format):
8
+ *
9
+ * ┌──────────────────────────────────────────────────────────────────┐
10
+ * │ 1. Keychain: `security find-generic-password -s "<svc>" -w` │
11
+ * │ → base64 password string │
12
+ * │ │
13
+ * │ 2. Key derivation: │
14
+ * │ PBKDF2(password, salt="saltysalt", iter=1003, len=16, sha1) │
15
+ * │ → 16-byte AES key │
16
+ * │ │
17
+ * │ 3. For each cookie with encrypted_value starting with "v10": │
18
+ * │ - Ciphertext = encrypted_value[3:] │
19
+ * │ - IV = 16 bytes of 0x20 (space character) │
20
+ * │ - Plaintext = AES-128-CBC-decrypt(key, iv, ciphertext) │
21
+ * │ - Remove PKCS7 padding │
22
+ * │ - Skip first 32 bytes (HMAC-SHA256 authentication tag) │
23
+ * │ - Remaining bytes = cookie value (UTF-8) │
24
+ * │ │
25
+ * │ 4. If encrypted_value is empty but `value` field is set, │
26
+ * │ use value directly (unencrypted cookie) │
27
+ * │ │
28
+ * │ 5. Chromium epoch: microseconds since 1601-01-01 │
29
+ * │ Unix seconds = (epoch - 11644473600000000) / 1000000 │
30
+ * │ │
31
+ * │ 6. sameSite: 0→"None", 1→"Lax", 2→"Strict", else→"Lax" │
32
+ * └──────────────────────────────────────────────────────────────────┘
33
+ */
34
+ export interface BrowserInfo {
35
+ name: string;
36
+ dataDir: string;
37
+ keychainService: string;
38
+ aliases: string[];
39
+ }
40
+ export interface DomainEntry {
41
+ domain: string;
42
+ count: number;
43
+ }
44
+ export interface ImportResult {
45
+ cookies: PlaywrightCookie[];
46
+ count: number;
47
+ failed: number;
48
+ domainCounts: Record<string, number>;
49
+ }
50
+ export interface PlaywrightCookie {
51
+ name: string;
52
+ value: string;
53
+ domain: string;
54
+ path: string;
55
+ expires: number;
56
+ secure: boolean;
57
+ httpOnly: boolean;
58
+ sameSite: 'Strict' | 'Lax' | 'None';
59
+ }
60
+ export declare class CookieImportError extends Error {
61
+ code: string;
62
+ action?: "retry" | undefined;
63
+ constructor(message: string, code: string, action?: "retry" | undefined);
64
+ }
65
+ export declare function findInstalledBrowsers(): BrowserInfo[];
66
+ export declare function listDomains(browserName: string, profile?: string): {
67
+ domains: DomainEntry[];
68
+ browser: string;
69
+ };
70
+ export declare function importCookies(browserName: string, domains: string[], profile?: string): Promise<ImportResult>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Cookie picker route handler — HTTP + Playwright glue
3
+ *
4
+ * Handles all /cookie-picker/* routes. Imports from cookie-import-browser.ts
5
+ * (decryption) and cookie-picker-ui.ts (HTML generation).
6
+ *
7
+ * Routes (no auth — localhost-only, accepted risk):
8
+ * GET /cookie-picker → serves the picker HTML page
9
+ * GET /cookie-picker/browsers → list installed browsers
10
+ * GET /cookie-picker/domains → list domains + counts for a browser
11
+ * POST /cookie-picker/import → decrypt + import cookies to Playwright
12
+ * POST /cookie-picker/remove → clear cookies for domains
13
+ * GET /cookie-picker/imported → currently imported domains + counts
14
+ */
15
+ import type { BrowserManager } from './browser-manager.ts';
16
+ export declare function handleCookiePickerRoute(url: URL, req: Request, bm: BrowserManager): Promise<Response>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Cookie picker UI — self-contained HTML page
3
+ *
4
+ * Dark theme, two-panel layout, vanilla HTML/CSS/JS.
5
+ * Left: source browser domains with search + import buttons.
6
+ * Right: imported domains with trash buttons.
7
+ * No cookie values exposed anywhere.
8
+ */
9
+ export declare function getCookiePickerHTML(serverPort: number): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * find-browse — locate the @nntoan/gstack browse binary.
3
+ *
4
+ * Compiled to browse/dist/find-browse (standalone binary, no bun runtime needed).
5
+ * Outputs the absolute path to the browse binary on stdout, or exits 1 if not found.
6
+ */
7
+ export declare function locateBinary(): string | null;