@codemieai/code 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +375 -325
- package/bin/codemie-claude.js +23 -0
- package/bin/codemie-code.js +49 -11
- package/bin/codemie-codex.js +12 -13
- package/dist/agents/adapters/claude-code.d.ts +5 -0
- package/dist/agents/adapters/claude-code.d.ts.map +1 -1
- package/dist/agents/adapters/claude-code.js +76 -18
- package/dist/agents/adapters/claude-code.js.map +1 -1
- package/dist/agents/adapters/codex.d.ts +5 -0
- package/dist/agents/adapters/codex.d.ts.map +1 -1
- package/dist/agents/adapters/codex.js +75 -17
- package/dist/agents/adapters/codex.js.map +1 -1
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +187 -21
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/config.d.ts.map +1 -1
- package/dist/agents/codemie-code/config.js +29 -27
- package/dist/agents/codemie-code/config.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +16 -2
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +74 -6
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts +87 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.d.ts.map +1 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js +957 -0
- package/dist/agents/codemie-code/modes/contextAwarePlanning.js.map +1 -0
- package/dist/agents/codemie-code/modes/planMode.d.ts +116 -0
- package/dist/agents/codemie-code/modes/planMode.d.ts.map +1 -0
- package/dist/agents/codemie-code/modes/planMode.js +537 -0
- package/dist/agents/codemie-code/modes/planMode.js.map +1 -0
- package/dist/agents/codemie-code/prompts.d.ts +29 -0
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +129 -0
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/storage/todoStorage.d.ts +78 -0
- package/dist/agents/codemie-code/storage/todoStorage.d.ts.map +1 -0
- package/dist/agents/codemie-code/storage/todoStorage.js +225 -0
- package/dist/agents/codemie-code/storage/todoStorage.js.map +1 -0
- package/dist/agents/codemie-code/tokenUtils.js +1 -1
- package/dist/agents/codemie-code/tokenUtils.js.map +1 -1
- package/dist/agents/codemie-code/tools/index.d.ts +26 -0
- package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/index.js +182 -14
- package/dist/agents/codemie-code/tools/index.js.map +1 -1
- package/dist/agents/codemie-code/tools/planning.d.ts +53 -0
- package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -0
- package/dist/agents/codemie-code/tools/planning.js +224 -0
- package/dist/agents/codemie-code/tools/planning.js.map +1 -0
- package/dist/agents/codemie-code/types.d.ts +170 -6
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/codemie-code/ui/progressTracker.d.ts +125 -0
- package/dist/agents/codemie-code/ui/progressTracker.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/progressTracker.js +343 -0
- package/dist/agents/codemie-code/ui/progressTracker.js.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts +112 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.js +318 -0
- package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -0
- package/dist/agents/codemie-code/ui.d.ts +106 -10
- package/dist/agents/codemie-code/ui.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui.js +913 -129
- package/dist/agents/codemie-code/ui.js.map +1 -1
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts +87 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.js +293 -0
- package/dist/agents/codemie-code/utils/progressionEnforcer.js.map +1 -0
- package/dist/agents/codemie-code/utils/todoParser.d.ts +41 -0
- package/dist/agents/codemie-code/utils/todoParser.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/todoParser.js +305 -0
- package/dist/agents/codemie-code/utils/todoParser.js.map +1 -0
- package/dist/agents/codemie-code/utils/todoValidator.d.ts +65 -0
- package/dist/agents/codemie-code/utils/todoValidator.d.ts.map +1 -0
- package/dist/agents/codemie-code/utils/todoValidator.js +249 -0
- package/dist/agents/codemie-code/utils/todoValidator.js.map +1 -0
- package/dist/agents/codemie-code/validators/planValidator.d.ts +94 -0
- package/dist/agents/codemie-code/validators/planValidator.d.ts.map +1 -0
- package/dist/agents/codemie-code/validators/planValidator.js +281 -0
- package/dist/agents/codemie-code/validators/planValidator.js.map +1 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +7 -5
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +3 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +170 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +40 -13
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +209 -16
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/env.js +3 -3
- package/dist/cli/commands/env.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +2 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +15 -9
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +177 -11
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/tools.d.ts +6 -0
- package/dist/cli/commands/tools.d.ts.map +1 -0
- package/dist/cli/commands/tools.js +244 -0
- package/dist/cli/commands/tools.js.map +1 -0
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +424 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.js +39 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/clients/adapters/github.d.ts +17 -0
- package/dist/clients/adapters/github.d.ts.map +1 -0
- package/dist/clients/adapters/github.js +150 -0
- package/dist/clients/adapters/github.js.map +1 -0
- package/dist/clients/adapters/gitlab.d.ts +17 -0
- package/dist/clients/adapters/gitlab.d.ts.map +1 -0
- package/dist/clients/adapters/gitlab.js +147 -0
- package/dist/clients/adapters/gitlab.js.map +1 -0
- package/dist/clients/registry.d.ts +20 -0
- package/dist/clients/registry.d.ts.map +1 -0
- package/dist/clients/registry.js +27 -0
- package/dist/clients/registry.js.map +1 -0
- package/dist/tools/detector.d.ts +33 -0
- package/dist/tools/detector.d.ts.map +1 -0
- package/dist/tools/detector.js +145 -0
- package/dist/tools/detector.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/manager.d.ts +21 -0
- package/dist/tools/manager.d.ts.map +1 -0
- package/dist/tools/manager.js +104 -0
- package/dist/tools/manager.js.map +1 -0
- package/dist/tools/registry.d.ts +8 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +36 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +41 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +5 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/sso.d.ts +42 -0
- package/dist/types/sso.d.ts.map +1 -0
- package/dist/types/sso.js +2 -0
- package/dist/types/sso.js.map +1 -0
- package/dist/utils/agent-compatibility.d.ts +32 -0
- package/dist/utils/agent-compatibility.d.ts.map +1 -0
- package/dist/utils/agent-compatibility.js +140 -0
- package/dist/utils/agent-compatibility.js.map +1 -0
- package/dist/utils/codemie-integration-validator.d.ts +17 -0
- package/dist/utils/codemie-integration-validator.d.ts.map +1 -0
- package/dist/utils/codemie-integration-validator.js +105 -0
- package/dist/utils/codemie-integration-validator.js.map +1 -0
- package/dist/utils/codemie-model-fetcher.d.ts +11 -0
- package/dist/utils/codemie-model-fetcher.d.ts.map +1 -0
- package/dist/utils/codemie-model-fetcher.js +242 -0
- package/dist/utils/codemie-model-fetcher.js.map +1 -0
- package/dist/utils/config-loader.d.ts +23 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +73 -27
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/credential-store.d.ts +16 -0
- package/dist/utils/credential-store.d.ts.map +1 -0
- package/dist/utils/credential-store.js +109 -0
- package/dist/utils/credential-store.js.map +1 -0
- package/dist/utils/first-time.d.ts +1 -1
- package/dist/utils/first-time.d.ts.map +1 -1
- package/dist/utils/first-time.js +52 -71
- package/dist/utils/first-time.js.map +1 -1
- package/dist/utils/health-checker.d.ts.map +1 -1
- package/dist/utils/health-checker.js +5 -1
- package/dist/utils/health-checker.js.map +1 -1
- package/dist/utils/model-fetcher.d.ts.map +1 -1
- package/dist/utils/model-fetcher.js +15 -2
- package/dist/utils/model-fetcher.js.map +1 -1
- package/dist/utils/sso-auth.d.ts +15 -0
- package/dist/utils/sso-auth.d.ts.map +1 -0
- package/dist/utils/sso-auth.js +207 -0
- package/dist/utils/sso-auth.js.map +1 -0
- package/dist/utils/sso-gateway.d.ts +47 -0
- package/dist/utils/sso-gateway.d.ts.map +1 -0
- package/dist/utils/sso-gateway.js +298 -0
- package/dist/utils/sso-gateway.js.map +1 -0
- package/dist/workflows/detector.d.ts +37 -0
- package/dist/workflows/detector.d.ts.map +1 -0
- package/dist/workflows/detector.js +160 -0
- package/dist/workflows/detector.js.map +1 -0
- package/dist/workflows/index.d.ts +8 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +8 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/installer.d.ts +24 -0
- package/dist/workflows/installer.d.ts.map +1 -0
- package/dist/workflows/installer.js +105 -0
- package/dist/workflows/installer.js.map +1 -0
- package/dist/workflows/registry.d.ts +29 -0
- package/dist/workflows/registry.d.ts.map +1 -0
- package/dist/workflows/registry.js +54 -0
- package/dist/workflows/registry.js.map +1 -0
- package/dist/workflows/templates/github/metadata.d.ts +6 -0
- package/dist/workflows/templates/github/metadata.d.ts.map +1 -0
- package/dist/workflows/templates/github/metadata.js +111 -0
- package/dist/workflows/templates/github/metadata.js.map +1 -0
- package/dist/workflows/templates/gitlab/metadata.d.ts +6 -0
- package/dist/workflows/templates/gitlab/metadata.d.ts.map +1 -0
- package/dist/workflows/templates/gitlab/metadata.js +14 -0
- package/dist/workflows/templates/gitlab/metadata.js.map +1 -0
- package/dist/workflows/types.d.ts +71 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +5 -0
- package/dist/workflows/types.js.map +1 -0
- package/package.json +19 -6
- package/src/workflows/templates/github/code-ci.yml +529 -0
- package/src/workflows/templates/github/inline-fix.yml +665 -0
- package/src/workflows/templates/github/pr-review.yml +677 -0
- package/.claude/agents/README.md +0 -298
- package/.claude/agents/release-manager.md +0 -857
- package/.codemie/guides/git-workflow.md +0 -493
- package/CLAUDE.md +0 -225
- package/config.example.json +0 -10
- package/dist/agents/codemie-code/streaming/events.d.ts +0 -7
- package/dist/agents/codemie-code/streaming/events.d.ts.map +0 -1
- package/dist/agents/codemie-code/streaming/events.js +0 -7
- package/dist/agents/codemie-code/streaming/events.js.map +0 -1
- package/dist/agents/codemie-code/streaming/formatter.d.ts +0 -2
- package/dist/agents/codemie-code/streaming/formatter.d.ts.map +0 -1
- package/dist/agents/codemie-code/streaming/formatter.js +0 -2
- package/dist/agents/codemie-code/streaming/formatter.js.map +0 -1
- package/dist/agents/codemie-code/streaming/ui.d.ts +0 -2
- package/dist/agents/codemie-code/streaming/ui.d.ts.map +0 -1
- package/dist/agents/codemie-code/streaming/ui.js +0 -2
- package/dist/agents/codemie-code/streaming/ui.js.map +0 -1
- package/dist/agents/codemie-code/tools/command.d.ts +0 -2
- package/dist/agents/codemie-code/tools/command.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/command.js +0 -2
- package/dist/agents/codemie-code/tools/command.js.map +0 -1
- package/dist/agents/codemie-code/tools/filesystem.d.ts +0 -2
- package/dist/agents/codemie-code/tools/filesystem.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/filesystem.js +0 -2
- package/dist/agents/codemie-code/tools/filesystem.js.map +0 -1
- package/dist/agents/codemie-code/tools/git.d.ts +0 -2
- package/dist/agents/codemie-code/tools/git.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/git.js +0 -2
- package/dist/agents/codemie-code/tools/git.js.map +0 -1
- package/dist/agents/codemie-code/tools/security.d.ts +0 -2
- package/dist/agents/codemie-code/tools/security.d.ts.map +0 -1
- package/dist/agents/codemie-code/tools/security.js +0 -2
- package/dist/agents/codemie-code/tools/security.js.map +0 -1
- package/eslint.config.mjs +0 -43
- package/scripts/README.md +0 -80
- package/scripts/release.sh +0 -156
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow management types
|
|
3
|
+
*/
|
|
4
|
+
export type VCSProvider = 'github' | 'gitlab';
|
|
5
|
+
export type WorkflowTriggerType = 'pull_request' | 'issue_comment' | 'pull_request_review_comment' | 'pull_request_review' | 'issues' | 'workflow_dispatch' | 'push' | 'schedule';
|
|
6
|
+
export interface WorkflowTrigger {
|
|
7
|
+
type: WorkflowTriggerType;
|
|
8
|
+
config?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export type PermissionLevel = 'trusted-only' | 'all' | 'collaborators';
|
|
11
|
+
export interface WorkflowPermissions {
|
|
12
|
+
level: PermissionLevel;
|
|
13
|
+
contents?: 'read' | 'write';
|
|
14
|
+
pullRequests?: 'read' | 'write';
|
|
15
|
+
issues?: 'read' | 'write';
|
|
16
|
+
idToken?: 'write';
|
|
17
|
+
actions?: 'read';
|
|
18
|
+
statuses?: 'write';
|
|
19
|
+
}
|
|
20
|
+
export interface WorkflowConfig {
|
|
21
|
+
timeout?: number;
|
|
22
|
+
maxTurns?: number;
|
|
23
|
+
model?: string;
|
|
24
|
+
environment?: string;
|
|
25
|
+
envVars?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface WorkflowTemplate {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
provider: VCSProvider;
|
|
32
|
+
version: string;
|
|
33
|
+
triggers: WorkflowTrigger[];
|
|
34
|
+
permissions: WorkflowPermissions;
|
|
35
|
+
config: WorkflowConfig;
|
|
36
|
+
templatePath: string;
|
|
37
|
+
dependencies: WorkflowDependencies;
|
|
38
|
+
category: WorkflowCategory;
|
|
39
|
+
}
|
|
40
|
+
export interface WorkflowDependencies {
|
|
41
|
+
secrets: string[];
|
|
42
|
+
tools: string[];
|
|
43
|
+
optionalSecrets?: string[];
|
|
44
|
+
}
|
|
45
|
+
export type WorkflowCategory = 'code-review' | 'automation' | 'ci-cd' | 'security';
|
|
46
|
+
export interface InstalledWorkflow {
|
|
47
|
+
id: string;
|
|
48
|
+
provider: VCSProvider;
|
|
49
|
+
filePath: string;
|
|
50
|
+
installedAt: Date;
|
|
51
|
+
version: string;
|
|
52
|
+
config: WorkflowConfig;
|
|
53
|
+
}
|
|
54
|
+
export interface WorkflowInstallOptions {
|
|
55
|
+
interactive?: boolean;
|
|
56
|
+
dryRun?: boolean;
|
|
57
|
+
force?: boolean;
|
|
58
|
+
provider?: VCSProvider;
|
|
59
|
+
triggers?: WorkflowTriggerType[];
|
|
60
|
+
permissions?: PermissionLevel;
|
|
61
|
+
timeout?: number;
|
|
62
|
+
maxTurns?: number;
|
|
63
|
+
environment?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface VCSDetectionResult {
|
|
66
|
+
provider: VCSProvider | null;
|
|
67
|
+
remoteUrl: string | null;
|
|
68
|
+
isGitRepo: boolean;
|
|
69
|
+
workflowDir: string | null;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,eAAe,GACf,6BAA6B,GAC7B,qBAAqB,GACrB,QAAQ,GACR,mBAAmB,GACnB,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,KAAK,GAAG,eAAe,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,oBAAoB,CAAC;IACnC,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEnF,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemieai/code",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "CodeMie - CLI wrapper for managing multiple AI coding agents",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "AI/Run CodeMie CLI - Professional CLI wrapper for managing multiple AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,10 +11,20 @@
|
|
|
11
11
|
"codemie-claude": "./bin/codemie-claude.js",
|
|
12
12
|
"codemie-codex": "./bin/codemie-codex.js"
|
|
13
13
|
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"bin",
|
|
17
|
+
"src/workflows/templates/**/*.yml",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
14
21
|
"scripts": {
|
|
15
22
|
"build": "tsc",
|
|
16
23
|
"dev": "tsc --watch",
|
|
17
|
-
"
|
|
24
|
+
"test": "vitest",
|
|
25
|
+
"test:ui": "vitest --ui",
|
|
26
|
+
"test:run": "vitest run",
|
|
27
|
+
"lint": "eslint 'src/**/*.ts' --max-warnings=0",
|
|
18
28
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
19
29
|
"license-check": "npx license-checker --summary --onlyAllow 'MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;CC0-1.0;Unlicense;BlueOak-1.0.0;Python-2.0;CC-BY-4.0;Apache*;(MIT OR CC0-1.0)'",
|
|
20
30
|
"ci": "npm run license-check && npm run lint && npm run build",
|
|
@@ -29,12 +39,11 @@
|
|
|
29
39
|
"codex",
|
|
30
40
|
"wrapper"
|
|
31
41
|
],
|
|
32
|
-
"author": "
|
|
42
|
+
"author": "AI/Run Team",
|
|
33
43
|
"license": "Apache-2.0",
|
|
34
44
|
"dependencies": {
|
|
35
45
|
"@clack/core": "^0.5.0",
|
|
36
46
|
"@clack/prompts": "^0.11.0",
|
|
37
|
-
"@langchain/anthropic": "^1.0.0",
|
|
38
47
|
"@langchain/core": "^1.0.4",
|
|
39
48
|
"@langchain/langgraph": "^1.0.2",
|
|
40
49
|
"@langchain/openai": "^1.1.0",
|
|
@@ -42,6 +51,8 @@
|
|
|
42
51
|
"commander": "^11.1.0",
|
|
43
52
|
"dotenv": "^16.3.1",
|
|
44
53
|
"inquirer": "^9.2.12",
|
|
54
|
+
"keytar": "^7.9.0",
|
|
55
|
+
"open": "^8.4.2",
|
|
45
56
|
"ora": "^7.0.1",
|
|
46
57
|
"zod": "^4.1.12"
|
|
47
58
|
},
|
|
@@ -51,8 +62,10 @@
|
|
|
51
62
|
"@types/node": "^20.10.5",
|
|
52
63
|
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
53
64
|
"@typescript-eslint/parser": "^8.46.2",
|
|
65
|
+
"@vitest/ui": "^4.0.10",
|
|
54
66
|
"eslint": "^9.38.0",
|
|
55
|
-
"typescript": "^5.3.3"
|
|
67
|
+
"typescript": "^5.3.3",
|
|
68
|
+
"vitest": "^4.0.10"
|
|
56
69
|
},
|
|
57
70
|
"engines": {
|
|
58
71
|
"node": ">=24.0.0"
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
name: CodeMie Code CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Respond to issues created or when @codemie is mentioned in issue comments
|
|
5
|
+
issues:
|
|
6
|
+
types: [opened]
|
|
7
|
+
issue_comment:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
# Manual workflow dispatch with custom task
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
task_description:
|
|
14
|
+
description: 'Task for CodeMie Code to implement'
|
|
15
|
+
required: true
|
|
16
|
+
type: string
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
codemie:
|
|
20
|
+
# Run on:
|
|
21
|
+
# - Manual workflow dispatch
|
|
22
|
+
# - New issues created
|
|
23
|
+
# - @codemie mentioned in issue comments (not on PRs - those go to inline-fix)
|
|
24
|
+
if: |
|
|
25
|
+
github.event_name == 'workflow_dispatch' ||
|
|
26
|
+
(github.event_name == 'issues' && github.event.action == 'opened') ||
|
|
27
|
+
(github.event_name == 'issue_comment' &&
|
|
28
|
+
github.event.issue.pull_request == null &&
|
|
29
|
+
contains(github.event.comment.body, '@codemie'))
|
|
30
|
+
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
environment: dev # Use the 'dev' environment for secrets
|
|
33
|
+
|
|
34
|
+
permissions:
|
|
35
|
+
contents: write
|
|
36
|
+
pull-requests: write
|
|
37
|
+
issues: write
|
|
38
|
+
id-token: write
|
|
39
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- name: Checkout repository
|
|
43
|
+
uses: actions/checkout@v4
|
|
44
|
+
with:
|
|
45
|
+
fetch-depth: 0 # Full history for better context
|
|
46
|
+
|
|
47
|
+
- name: Set up Node.js
|
|
48
|
+
uses: actions/setup-node@v4
|
|
49
|
+
with:
|
|
50
|
+
node-version: '24'
|
|
51
|
+
|
|
52
|
+
- name: Cache CodeMie CLI
|
|
53
|
+
id: cache-codemie-cli
|
|
54
|
+
uses: actions/cache@v4
|
|
55
|
+
with:
|
|
56
|
+
path: ~/.npm
|
|
57
|
+
key: codemie-cli-${{ runner.os }}-${{ hashFiles('~/.npm/_cacache') }}
|
|
58
|
+
restore-keys: |
|
|
59
|
+
codemie-cli-${{ runner.os }}-
|
|
60
|
+
|
|
61
|
+
- name: Install CodeMie CLI
|
|
62
|
+
run: npm install -g @codemieai/code
|
|
63
|
+
|
|
64
|
+
- name: Install Claude Code
|
|
65
|
+
run: codemie install claude
|
|
66
|
+
|
|
67
|
+
- name: Set up Python
|
|
68
|
+
uses: actions/setup-python@v5
|
|
69
|
+
with:
|
|
70
|
+
python-version: '3.11'
|
|
71
|
+
|
|
72
|
+
- name: Install Poetry
|
|
73
|
+
uses: snok/install-poetry@v1
|
|
74
|
+
with:
|
|
75
|
+
version: '1.8.0'
|
|
76
|
+
virtualenvs-create: true
|
|
77
|
+
virtualenvs-in-project: true
|
|
78
|
+
|
|
79
|
+
- name: Cache Poetry dependencies
|
|
80
|
+
uses: actions/cache@v4
|
|
81
|
+
with:
|
|
82
|
+
path: ~/.cache/pypoetry
|
|
83
|
+
key: poetry-cache-${{ runner.os }}-py3.11-${{ hashFiles('**/poetry.lock') }}
|
|
84
|
+
restore-keys: |
|
|
85
|
+
poetry-cache-${{ runner.os }}-py3.11-
|
|
86
|
+
|
|
87
|
+
- name: Load cached venv
|
|
88
|
+
id: cached-poetry-dependencies
|
|
89
|
+
uses: actions/cache@v4
|
|
90
|
+
with:
|
|
91
|
+
path: .venv
|
|
92
|
+
key: venv-${{ runner.os }}-py3.11-${{ hashFiles('**/poetry.lock') }}
|
|
93
|
+
restore-keys: |
|
|
94
|
+
venv-${{ runner.os }}-py3.11-
|
|
95
|
+
|
|
96
|
+
- name: Install dependencies
|
|
97
|
+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
98
|
+
run: |
|
|
99
|
+
poetry install --no-interaction --no-root
|
|
100
|
+
poetry install --no-interaction
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies (cache hit)
|
|
103
|
+
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
|
|
104
|
+
run: |
|
|
105
|
+
echo "✅ Using cached dependencies"
|
|
106
|
+
poetry install --no-interaction --no-root
|
|
107
|
+
poetry install --no-interaction
|
|
108
|
+
|
|
109
|
+
- name: Configure Git
|
|
110
|
+
run: |
|
|
111
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
112
|
+
git config --global user.name "github-actions[bot]"
|
|
113
|
+
|
|
114
|
+
- name: Verify AWS Credentials
|
|
115
|
+
run: |
|
|
116
|
+
echo "Checking AWS credentials..."
|
|
117
|
+
if [ -z "${{ secrets.AWS_REGION }}" ]; then
|
|
118
|
+
echo "❌ ERROR: AWS_REGION secret is not set"
|
|
119
|
+
exit 1
|
|
120
|
+
fi
|
|
121
|
+
if [ -z "${{ secrets.AWS_ACCESS_KEY_ID }}" ]; then
|
|
122
|
+
echo "❌ ERROR: AWS_ACCESS_KEY_ID secret is not set"
|
|
123
|
+
exit 1
|
|
124
|
+
fi
|
|
125
|
+
if [ -z "${{ secrets.AWS_SECRET_ACCESS_KEY }}" ]; then
|
|
126
|
+
echo "❌ ERROR: AWS_SECRET_ACCESS_KEY secret is not set"
|
|
127
|
+
exit 1
|
|
128
|
+
fi
|
|
129
|
+
echo "✅ All AWS secrets are configured"
|
|
130
|
+
|
|
131
|
+
# Verify credentials work
|
|
132
|
+
export AWS_REGION="${{ secrets.AWS_REGION }}"
|
|
133
|
+
export AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}"
|
|
134
|
+
export AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}"
|
|
135
|
+
|
|
136
|
+
# Test AWS credentials
|
|
137
|
+
if command -v aws &> /dev/null; then
|
|
138
|
+
echo "Testing AWS credentials..."
|
|
139
|
+
aws sts get-caller-identity || echo "⚠️ Warning: Could not verify AWS credentials, but will proceed"
|
|
140
|
+
else
|
|
141
|
+
echo "AWS CLI not available for credential verification, proceeding..."
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
- name: Run CodeMie AI Implementation
|
|
145
|
+
id: claude
|
|
146
|
+
env:
|
|
147
|
+
# AWS Bedrock Configuration
|
|
148
|
+
CLAUDE_CODE_USE_BEDROCK: "1"
|
|
149
|
+
AWS_REGION: ${{ secrets.AWS_REGION }}
|
|
150
|
+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
151
|
+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
152
|
+
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
|
|
153
|
+
# Project Configuration
|
|
154
|
+
PYTHONPATH: "src"
|
|
155
|
+
POETRY_VIRTUALENVS_IN_PROJECT: "true"
|
|
156
|
+
# CI/CD Configuration
|
|
157
|
+
CI: "true"
|
|
158
|
+
GITHUB_ACTIONS: "true"
|
|
159
|
+
# Claude Configuration
|
|
160
|
+
MAX_TURNS: ${{ vars.CODEMIE_MAX_TURNS || '50' }}
|
|
161
|
+
run: |
|
|
162
|
+
# Determine the base prompt and context based on trigger type
|
|
163
|
+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
164
|
+
BASE_PROMPT="${{ github.event.inputs.task_description }}"
|
|
165
|
+
ISSUE_NUMBER=""
|
|
166
|
+
elif [ "${{ github.event_name }}" == "issues" ]; then
|
|
167
|
+
BASE_PROMPT="Implement a fix for issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
|
|
168
|
+
|
|
169
|
+
Issue Description:
|
|
170
|
+
${{ github.event.issue.body }}"
|
|
171
|
+
ISSUE_NUMBER="${{ github.event.issue.number }}"
|
|
172
|
+
elif [ "${{ github.event_name }}" == "issue_comment" ]; then
|
|
173
|
+
BASE_PROMPT="Address the request in issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}
|
|
174
|
+
|
|
175
|
+
Comment from @${{ github.event.comment.user.login }}:
|
|
176
|
+
${{ github.event.comment.body }}"
|
|
177
|
+
ISSUE_NUMBER="${{ github.event.issue.number }}"
|
|
178
|
+
else
|
|
179
|
+
BASE_PROMPT="Implement the requested changes"
|
|
180
|
+
ISSUE_NUMBER=""
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_ENV
|
|
184
|
+
|
|
185
|
+
# Add verification instructions to the prompt
|
|
186
|
+
cat > /tmp/full-prompt.txt << 'PROMPT_EOF'
|
|
187
|
+
${BASE_PROMPT}
|
|
188
|
+
|
|
189
|
+
## CRITICAL: Verification Steps
|
|
190
|
+
|
|
191
|
+
After implementing your changes, you MUST:
|
|
192
|
+
|
|
193
|
+
1. **Run code quality checks**:
|
|
194
|
+
```bash
|
|
195
|
+
source .venv/bin/activate && make ruff-fix
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
2. **Run all tests**:
|
|
199
|
+
```bash
|
|
200
|
+
source .venv/bin/activate && make test
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
3. **Verify everything passes**:
|
|
204
|
+
- If ruff reports errors, fix them
|
|
205
|
+
- If tests fail, fix the failing tests or your implementation
|
|
206
|
+
- Re-run until both pass
|
|
207
|
+
|
|
208
|
+
4. **Only then commit your changes**
|
|
209
|
+
|
|
210
|
+
DO NOT commit code that fails tests or ruff checks. The workflow will fail if verification doesn't pass.
|
|
211
|
+
PROMPT_EOF
|
|
212
|
+
|
|
213
|
+
# Replace the variable
|
|
214
|
+
sed -i "s|\${BASE_PROMPT}|${BASE_PROMPT}|g" /tmp/full-prompt.txt
|
|
215
|
+
|
|
216
|
+
PROMPT="$(cat /tmp/full-prompt.txt)"
|
|
217
|
+
|
|
218
|
+
# Set model from secret or use default
|
|
219
|
+
MODEL="${{ secrets.ANTHROPIC_MODEL }}"
|
|
220
|
+
if [ -z "$MODEL" ]; then
|
|
221
|
+
MODEL="anthropic.claude-3-5-sonnet-20241022-v2:0"
|
|
222
|
+
fi
|
|
223
|
+
|
|
224
|
+
echo "================================================"
|
|
225
|
+
echo "CodeMie Code CI Configuration"
|
|
226
|
+
echo "================================================"
|
|
227
|
+
echo "Event: ${{ github.event_name }}"
|
|
228
|
+
echo "Model: $MODEL"
|
|
229
|
+
echo "AWS Region: $AWS_REGION"
|
|
230
|
+
echo "AWS Access Key ID: ${AWS_ACCESS_KEY_ID:0:8}..."
|
|
231
|
+
echo "Bedrock Enabled: $CLAUDE_CODE_USE_BEDROCK"
|
|
232
|
+
echo "Prompt: $PROMPT"
|
|
233
|
+
echo "================================================"
|
|
234
|
+
|
|
235
|
+
# Run CodeMie AI with timeout and verbose output
|
|
236
|
+
timeout 30m claude \
|
|
237
|
+
-p "$(cat /tmp/full-prompt.txt)" \
|
|
238
|
+
--model "$MODEL" \
|
|
239
|
+
--max-turns "${MAX_TURNS}" \
|
|
240
|
+
--dangerously-skip-permissions \
|
|
241
|
+
--allowedTools "Bash(*),Read(*),Write(*),Edit(*),Grep(*),Glob(*)" \
|
|
242
|
+
--debug \
|
|
243
|
+
2>&1 | tee /tmp/claude-output.log || {
|
|
244
|
+
EXIT_CODE=$?
|
|
245
|
+
echo "CodeMie AI exited with code: $EXIT_CODE"
|
|
246
|
+
if [ $EXIT_CODE -eq 124 ]; then
|
|
247
|
+
echo "Error: CodeMie AI timed out after 30 minutes"
|
|
248
|
+
exit 1
|
|
249
|
+
fi
|
|
250
|
+
# Show last 100 lines of output for debugging
|
|
251
|
+
echo "=== Last 100 lines of CodeMie AI output ==="
|
|
252
|
+
tail -n 100 /tmp/claude-output.log
|
|
253
|
+
exit $EXIT_CODE
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
echo "=== CodeMie AI execution completed ==="
|
|
257
|
+
|
|
258
|
+
- name: Verify Code Quality (Safety Check)
|
|
259
|
+
id: verify
|
|
260
|
+
run: |
|
|
261
|
+
echo "================================================"
|
|
262
|
+
echo "Running Safety Verification"
|
|
263
|
+
echo "================================================"
|
|
264
|
+
echo "This is a final safety check to ensure CodeMie AI"
|
|
265
|
+
echo "properly ran tests and ruff checks."
|
|
266
|
+
echo ""
|
|
267
|
+
|
|
268
|
+
# Activate virtual environment and run verification
|
|
269
|
+
source .venv/bin/activate && make verify || {
|
|
270
|
+
EXIT_CODE=$?
|
|
271
|
+
echo ""
|
|
272
|
+
echo "❌ Verification failed with exit code: $EXIT_CODE"
|
|
273
|
+
echo ""
|
|
274
|
+
echo "⚠️ WARNING: CodeMie AI should have run these checks before committing!"
|
|
275
|
+
echo " Please review the implementation to ensure the AI followed instructions."
|
|
276
|
+
echo ""
|
|
277
|
+
exit $EXIT_CODE
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
echo ""
|
|
281
|
+
echo "✅ All verification checks passed"
|
|
282
|
+
echo "✅ CodeMie AI successfully implemented and verified the changes"
|
|
283
|
+
|
|
284
|
+
- name: Upload CodeMie Code Output
|
|
285
|
+
if: always()
|
|
286
|
+
uses: actions/upload-artifact@v4
|
|
287
|
+
with:
|
|
288
|
+
name: codemie-code-output-${{ github.run_number }}
|
|
289
|
+
path: /tmp/claude-output.log
|
|
290
|
+
retention-days: 30
|
|
291
|
+
|
|
292
|
+
- name: Commit and Push Changes
|
|
293
|
+
if: success() && steps.verify.outcome == 'success'
|
|
294
|
+
run: |
|
|
295
|
+
echo "Checking for changes..."
|
|
296
|
+
git status
|
|
297
|
+
|
|
298
|
+
# Check if there are any changes to commit
|
|
299
|
+
if git diff --quiet && git diff --cached --quiet; then
|
|
300
|
+
echo "✅ No changes to commit"
|
|
301
|
+
exit 0
|
|
302
|
+
fi
|
|
303
|
+
|
|
304
|
+
echo "📝 Changes detected, committing..."
|
|
305
|
+
|
|
306
|
+
# Create branch name and commit message based on trigger
|
|
307
|
+
if [ -n "$ISSUE_NUMBER" ]; then
|
|
308
|
+
BRANCH_NAME="codemie/issue-${ISSUE_NUMBER}"
|
|
309
|
+
if [ "${{ github.event_name }}" == "issues" ]; then
|
|
310
|
+
COMMIT_MSG="fix: resolve #${ISSUE_NUMBER} - ${{ github.event.issue.title }}
|
|
311
|
+
|
|
312
|
+
Co-authored-by: CodeMie AI <codemie.ai@gmail.com>"
|
|
313
|
+
else
|
|
314
|
+
COMMIT_MSG="fix: address #${ISSUE_NUMBER} - ${{ github.event.issue.title }}
|
|
315
|
+
|
|
316
|
+
Co-authored-by: CodeMie AI <codemie.ai@gmail.com>"
|
|
317
|
+
fi
|
|
318
|
+
else
|
|
319
|
+
BRANCH_NAME="codemie/task-$(date +%Y%m%d-%H%M%S)"
|
|
320
|
+
COMMIT_MSG="feat: ${{ github.event.inputs.task_description }}
|
|
321
|
+
|
|
322
|
+
Co-authored-by: CodeMie AI <codemie.ai@gmail.com>"
|
|
323
|
+
fi
|
|
324
|
+
|
|
325
|
+
echo "Branch: $BRANCH_NAME"
|
|
326
|
+
|
|
327
|
+
# Create and checkout branch
|
|
328
|
+
git checkout -b "$BRANCH_NAME" 2>/dev/null || git checkout "$BRANCH_NAME"
|
|
329
|
+
|
|
330
|
+
# Stage all changes
|
|
331
|
+
git add -A
|
|
332
|
+
|
|
333
|
+
# Commit changes
|
|
334
|
+
git commit -m "$COMMIT_MSG"
|
|
335
|
+
|
|
336
|
+
# Push branch
|
|
337
|
+
git push -u origin "$BRANCH_NAME"
|
|
338
|
+
|
|
339
|
+
echo "✅ Changes committed and pushed to branch: $BRANCH_NAME"
|
|
340
|
+
|
|
341
|
+
- name: Create Pull Request
|
|
342
|
+
if: success() && steps.verify.outcome == 'success'
|
|
343
|
+
env:
|
|
344
|
+
GH_TOKEN: ${{ github.token }}
|
|
345
|
+
run: |
|
|
346
|
+
# Check if we have a branch to create PR from
|
|
347
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
348
|
+
|
|
349
|
+
if [ "$CURRENT_BRANCH" == "main" ] || [ "$CURRENT_BRANCH" == "master" ]; then
|
|
350
|
+
echo "⚠️ On main branch, no PR needed"
|
|
351
|
+
exit 0
|
|
352
|
+
fi
|
|
353
|
+
|
|
354
|
+
echo "Creating PR from branch: $CURRENT_BRANCH"
|
|
355
|
+
|
|
356
|
+
# Create PR title and body based on trigger
|
|
357
|
+
if [ -n "$ISSUE_NUMBER" ]; then
|
|
358
|
+
if [ "${{ github.event_name }}" == "issues" ]; then
|
|
359
|
+
PR_TITLE="🤖 Fix #${ISSUE_NUMBER}: ${{ github.event.issue.title }}"
|
|
360
|
+
PR_BODY="## Resolves
|
|
361
|
+
Closes #${ISSUE_NUMBER}
|
|
362
|
+
|
|
363
|
+
## Issue Description
|
|
364
|
+
${{ github.event.issue.body }}
|
|
365
|
+
|
|
366
|
+
## Changes
|
|
367
|
+
CodeMie AI has analyzed and implemented a fix for this issue.
|
|
368
|
+
|
|
369
|
+
## Verification
|
|
370
|
+
✅ All tests passed
|
|
371
|
+
✅ Code quality checks passed (Ruff)
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
🤖 This PR was automatically created by CodeMie AI via GitHub Actions
|
|
375
|
+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
376
|
+
else
|
|
377
|
+
PR_TITLE="🤖 Address #${ISSUE_NUMBER}: ${{ github.event.issue.title }}"
|
|
378
|
+
PR_BODY="## Related to
|
|
379
|
+
Addresses #${ISSUE_NUMBER}
|
|
380
|
+
|
|
381
|
+
## Comment Context
|
|
382
|
+
This PR addresses a request from @${{ github.event.comment.user.login }} in issue #${ISSUE_NUMBER}
|
|
383
|
+
|
|
384
|
+
## Changes
|
|
385
|
+
CodeMie AI has implemented the requested changes.
|
|
386
|
+
|
|
387
|
+
## Verification
|
|
388
|
+
✅ All tests passed
|
|
389
|
+
✅ Code quality checks passed (Ruff)
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
🤖 This PR was automatically created by CodeMie AI via GitHub Actions
|
|
393
|
+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
394
|
+
fi
|
|
395
|
+
else
|
|
396
|
+
PR_TITLE="🤖 CodeMie AI: ${{ github.event.inputs.task_description }}"
|
|
397
|
+
PR_BODY="## Task Description
|
|
398
|
+
|
|
399
|
+
${{ github.event.inputs.task_description }}
|
|
400
|
+
|
|
401
|
+
## Changes
|
|
402
|
+
CodeMie AI has implemented the requested changes.
|
|
403
|
+
|
|
404
|
+
## Verification
|
|
405
|
+
✅ All tests passed
|
|
406
|
+
✅ Code quality checks passed (Ruff)
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
🤖 This PR was automatically created by CodeMie AI via GitHub Actions
|
|
410
|
+
Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
411
|
+
fi
|
|
412
|
+
|
|
413
|
+
# Create PR using GitHub CLI and capture URL
|
|
414
|
+
PR_URL=$(gh pr create \
|
|
415
|
+
--title "$PR_TITLE" \
|
|
416
|
+
--body "$PR_BODY" \
|
|
417
|
+
--base main \
|
|
418
|
+
--head "$CURRENT_BRANCH" 2>&1) || {
|
|
419
|
+
echo "⚠️ PR might already exist or couldn't be created"
|
|
420
|
+
PR_URL=$(gh pr list --head "$CURRENT_BRANCH" --json url --jq '.[0].url' 2>/dev/null || echo "")
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if [ -n "$PR_URL" ]; then
|
|
424
|
+
echo "✅ Pull request created: $PR_URL"
|
|
425
|
+
echo "PR_URL=$PR_URL" >> $GITHUB_ENV
|
|
426
|
+
else
|
|
427
|
+
echo "⚠️ No PR URL available"
|
|
428
|
+
fi
|
|
429
|
+
|
|
430
|
+
- name: Comment on Issue
|
|
431
|
+
if: success() && steps.verify.outcome == 'success' && env.ISSUE_NUMBER != ''
|
|
432
|
+
env:
|
|
433
|
+
GH_TOKEN: ${{ github.token }}
|
|
434
|
+
run: |
|
|
435
|
+
ISSUE_NUM="${ISSUE_NUMBER}"
|
|
436
|
+
|
|
437
|
+
if [ -z "$ISSUE_NUM" ]; then
|
|
438
|
+
echo "No issue number found, skipping comment"
|
|
439
|
+
exit 0
|
|
440
|
+
fi
|
|
441
|
+
|
|
442
|
+
echo "Commenting on issue #${ISSUE_NUM}..."
|
|
443
|
+
|
|
444
|
+
# Create comment body
|
|
445
|
+
if [ -n "$PR_URL" ]; then
|
|
446
|
+
COMMENT="👋 Hi! I've analyzed this issue and created a fix.
|
|
447
|
+
|
|
448
|
+
**Pull Request**: ${PR_URL}
|
|
449
|
+
|
|
450
|
+
## What I did:
|
|
451
|
+
- ✅ Implemented the changes
|
|
452
|
+
- ✅ Ran code quality checks (Ruff)
|
|
453
|
+
- ✅ Ran all tests
|
|
454
|
+
|
|
455
|
+
Please review the PR. Once merged, this issue will be automatically closed.
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
🤖 _CodeMie AI - Automated by GitHub Actions_
|
|
459
|
+
[View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
|
460
|
+
else
|
|
461
|
+
COMMENT="👋 Hi! I've worked on this issue and made changes.
|
|
462
|
+
|
|
463
|
+
## What I did:
|
|
464
|
+
- ✅ Implemented the changes
|
|
465
|
+
- ✅ Ran code quality checks (Ruff)
|
|
466
|
+
- ✅ Ran all tests
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
🤖 _CodeMie AI - Automated by GitHub Actions_
|
|
470
|
+
[View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
|
471
|
+
fi
|
|
472
|
+
|
|
473
|
+
# Post comment using GitHub CLI
|
|
474
|
+
gh issue comment "${ISSUE_NUM}" --body "$COMMENT"
|
|
475
|
+
|
|
476
|
+
echo "✅ Comment posted to issue #${ISSUE_NUM}"
|
|
477
|
+
|
|
478
|
+
- name: Post Summary
|
|
479
|
+
if: always()
|
|
480
|
+
run: |
|
|
481
|
+
echo "## 🤖 CodeMie Code CI Summary" >> $GITHUB_STEP_SUMMARY
|
|
482
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
483
|
+
echo "**Workflow**: ${{ github.workflow }}" >> $GITHUB_STEP_SUMMARY
|
|
484
|
+
|
|
485
|
+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
486
|
+
echo "**Trigger**: Manual (workflow_dispatch)" >> $GITHUB_STEP_SUMMARY
|
|
487
|
+
echo "**Task**: ${{ github.event.inputs.task_description }}" >> $GITHUB_STEP_SUMMARY
|
|
488
|
+
elif [ "${{ github.event_name }}" == "issues" ]; then
|
|
489
|
+
echo "**Trigger**: New Issue #${{ github.event.issue.number }}" >> $GITHUB_STEP_SUMMARY
|
|
490
|
+
echo "**Issue**: ${{ github.event.issue.title }}" >> $GITHUB_STEP_SUMMARY
|
|
491
|
+
elif [ "${{ github.event_name }}" == "issue_comment" ]; then
|
|
492
|
+
echo "**Trigger**: Issue Comment (@codemie)" >> $GITHUB_STEP_SUMMARY
|
|
493
|
+
echo "**Issue**: #${{ github.event.issue.number }} - ${{ github.event.issue.title }}" >> $GITHUB_STEP_SUMMARY
|
|
494
|
+
fi
|
|
495
|
+
|
|
496
|
+
echo "**Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
|
|
497
|
+
|
|
498
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
499
|
+
echo "### 🔧 Configuration" >> $GITHUB_STEP_SUMMARY
|
|
500
|
+
echo "- **Provider**: AWS Bedrock" >> $GITHUB_STEP_SUMMARY
|
|
501
|
+
echo "- **AWS Region**: ${{ secrets.AWS_REGION && '✅ Configured' || '❌ Not set' }}" >> $GITHUB_STEP_SUMMARY
|
|
502
|
+
echo "- **AWS Credentials**: ${{ secrets.AWS_ACCESS_KEY_ID && '✅ Configured' || '❌ Not set' }}" >> $GITHUB_STEP_SUMMARY
|
|
503
|
+
echo "- **Model**: ${{ secrets.ANTHROPIC_MODEL && secrets.ANTHROPIC_MODEL || 'anthropic.claude-3-5-sonnet-20241022-v2:0 (default)' }}" >> $GITHUB_STEP_SUMMARY
|
|
504
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
505
|
+
|
|
506
|
+
echo "### ✅ Verification" >> $GITHUB_STEP_SUMMARY
|
|
507
|
+
if [ "${{ steps.verify.outcome }}" == "success" ]; then
|
|
508
|
+
echo "- **Tests**: ✅ Passed" >> $GITHUB_STEP_SUMMARY
|
|
509
|
+
echo "- **Code Quality (Ruff)**: ✅ Passed" >> $GITHUB_STEP_SUMMARY
|
|
510
|
+
else
|
|
511
|
+
echo "- **Tests**: ${{ steps.verify.outcome == 'failure' && '❌ Failed' || '⏭️ Skipped' }}" >> $GITHUB_STEP_SUMMARY
|
|
512
|
+
echo "- **Code Quality (Ruff)**: ${{ steps.verify.outcome == 'failure' && '❌ Failed' || '⏭️ Skipped' }}" >> $GITHUB_STEP_SUMMARY
|
|
513
|
+
fi
|
|
514
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
515
|
+
|
|
516
|
+
echo "### 📦 Outputs" >> $GITHUB_STEP_SUMMARY
|
|
517
|
+
if [ -n "$PR_URL" ]; then
|
|
518
|
+
echo "- **Pull Request**: [$PR_URL]($PR_URL) ✅" >> $GITHUB_STEP_SUMMARY
|
|
519
|
+
else
|
|
520
|
+
echo "- **Pull Request**: Not created (no changes or verification failed)" >> $GITHUB_STEP_SUMMARY
|
|
521
|
+
fi
|
|
522
|
+
echo "- **CodeMie Code Log**: Available in workflow artifacts" >> $GITHUB_STEP_SUMMARY
|
|
523
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
524
|
+
|
|
525
|
+
echo "### 📋 Next Steps" >> $GITHUB_STEP_SUMMARY
|
|
526
|
+
echo "1. Review the [CodeMie Code output artifact](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for detailed execution logs" >> $GITHUB_STEP_SUMMARY
|
|
527
|
+
if [ -n "$PR_URL" ]; then
|
|
528
|
+
echo "2. Review and merge the [Pull Request]($PR_URL)" >> $GITHUB_STEP_SUMMARY
|
|
529
|
+
fi
|