workspai 0.70.0 → 0.72.0
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 +43 -80
- package/contracts/artifact-remediation-plan.v1.json +49 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +19 -0
- package/contracts/workspace-repair-capabilities.v1.json +7 -1
- package/dist/analyze-5ENZTHOT.js +1 -0
- package/dist/{artifact-remediation-plan-URQL5MBN.js → artifact-remediation-plan-WDK5ISRU.js} +1 -1
- package/dist/autopilot-release-PNSWAVZG.js +1 -0
- package/dist/{chunk-EP6Q2QBU.js → chunk-2RF75G5T.js} +1 -1
- package/dist/{chunk-4R7STECB.js → chunk-5OLNT6YD.js} +63 -63
- package/dist/{chunk-GED7JURY.js → chunk-5PFFR5S7.js} +1 -1
- package/dist/{chunk-QZODGRAI.js → chunk-5TKRCE6F.js} +1 -1
- package/dist/{chunk-IGJA6GBQ.js → chunk-62YBFWHY.js} +1 -1
- package/dist/chunk-6WOFOOM7.js +7 -0
- package/dist/{chunk-ZLCLGIM6.js → chunk-7LKCWDX6.js} +1 -1
- package/dist/chunk-7Q7X4X5I.js +1 -0
- package/dist/chunk-BVWDG66W.js +1 -0
- package/dist/{chunk-DNZHKBQ3.js → chunk-COBU44T5.js} +1 -1
- package/dist/chunk-CQBM6BBP.js +2 -0
- package/dist/chunk-CY4QZ3PE.js +3 -0
- package/dist/{chunk-LE2I2E6R.js → chunk-D5RUGSBC.js} +2 -2
- package/dist/chunk-EDPUQXP6.js +5 -0
- package/dist/{chunk-IBJEQHJR.js → chunk-HV6EQMUJ.js} +24 -7
- package/dist/{chunk-V52R2W2Q.js → chunk-IX5Z6EK6.js} +1 -1
- package/dist/{chunk-N6FJZ62B.js → chunk-JQINCVK5.js} +1 -1
- package/dist/{chunk-GL3KLNIG.js → chunk-KVPTZMEV.js} +1 -1
- package/dist/{chunk-UT57IFS4.js → chunk-LDNX2R6V.js} +6 -6
- package/dist/{chunk-WUXJCSYO.js → chunk-LLEKVSMX.js} +1 -1
- package/dist/{chunk-ZPOZ6MDX.js → chunk-N2PAAQKI.js} +1 -1
- package/dist/{chunk-S2TOSHQW.js → chunk-ONV6WW7A.js} +1 -1
- package/dist/{chunk-TEMFNVO2.js → chunk-QVUVJU56.js} +1 -1
- package/dist/{chunk-AGZWDYMF.js → chunk-QYXX6G5O.js} +8 -8
- package/dist/{chunk-S42KDOGG.js → chunk-S66NO5BX.js} +1 -1
- package/dist/{chunk-KFTJVVJR.js → chunk-SATPH22S.js} +1 -1
- package/dist/{chunk-IFHM2SI6.js → chunk-SG3QRCMM.js} +1 -1
- package/dist/{chunk-Z7JIUA6I.js → chunk-SS7X2YF5.js} +1 -1
- package/dist/{chunk-IET57ZKN.js → chunk-T6KHOIEY.js} +1 -1
- package/dist/{chunk-TLMP2MGH.js → chunk-T6LCDLJ7.js} +1 -1
- package/dist/{chunk-QNHKUSBH.js → chunk-TDQ2PRHV.js} +1 -1
- package/dist/{chunk-3S2U7WRM.js → chunk-TQQEZQLC.js} +1 -1
- package/dist/{chunk-LU6CYDLN.js → chunk-UHAPXPGW.js} +1 -1
- package/dist/chunk-V4LCPLV6.js +1 -0
- package/dist/{chunk-GYN6RPNU.js → chunk-WMC2H7MJ.js} +1 -1
- package/dist/{chunk-PTSEDZIV.js → chunk-WPZUKU2B.js} +1 -1
- package/dist/chunk-X5ZNFXFI.js +1 -0
- package/dist/{create-BBALBC3U.js → create-7CWWGDXQ.js} +1 -1
- package/dist/{doctor-WWVY7NB6.js → doctor-WYBSI3GC.js} +1 -1
- package/dist/{dotnet-webapi-clean-XL4IBUQV.js → dotnet-webapi-clean-VJX6SGGP.js} +39 -33
- package/dist/{goal-lifecycle-CEUTKUNV.js → goal-lifecycle-PSPYQ4TR.js} +1 -1
- package/dist/{goal-pack-JQL3YOKT.js → goal-pack-G7SAYDIC.js} +1 -1
- package/dist/{gofiber-standard-OHHMCNMJ.js → gofiber-standard-I6ASLOEE.js} +77 -66
- package/dist/{gogin-standard-BAZXPOKL.js → gogin-standard-U2LSRLIP.js} +78 -67
- package/dist/index.js +121 -121
- package/dist/{pipeline-V46WWMP4.js → pipeline-NDV7DBB7.js} +1 -1
- package/dist/{project-agent-entry-MRAYG7QD.js → project-agent-entry-HEBGPLMX.js} +1 -1
- package/dist/{project-intelligence-lens-4BKPN4PE.js → project-intelligence-lens-QTQEZXUY.js} +1 -1
- package/dist/{project-test-coverage-4RRCHY5W.js → project-test-coverage-4BGDDBBL.js} +1 -1
- package/dist/{proof-carrying-change-B7ONTBYO.js → proof-carrying-change-SHO2E3DX.js} +1 -1
- package/dist/{rust-axum-CCJ6UCBW.js → rust-axum-JMV7UPO7.js} +25 -20
- package/dist/{springboot-standard-M5JQEJML.js → springboot-standard-OC2RS3KC.js} +41 -39
- package/dist/verified-goal-BSREU6R7.js +1 -0
- package/dist/{workspace-FJ6JRYWA.js → workspace-E3MM3AIE.js} +1 -1
- package/dist/{workspace-agent-sync-V33UGII3.js → workspace-agent-sync-NBIOSXCG.js} +1 -1
- package/dist/{workspace-context-O6UBCBEA.js → workspace-context-ZDXF6S7S.js} +1 -1
- package/dist/{workspace-contract-S2JYDA4K.js → workspace-contract-E7GVWM7W.js} +1 -1
- package/dist/{workspace-explain-RP6VJ6QM.js → workspace-explain-YB66UFAS.js} +1 -1
- package/dist/{workspace-foundation-7QXEJJKZ.js → workspace-foundation-LRLYPR36.js} +1 -1
- package/dist/{workspace-graph-stream-YY65R5EC.js → workspace-graph-stream-SJUCBPS4.js} +1 -1
- package/dist/workspace-graph-token-efficiency-BTIS6JXL.js +1 -0
- package/dist/{workspace-intelligence-LMR42ICR.js → workspace-intelligence-3IAAM3H3.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-S5OXVNLC.js → workspace-intelligence-benchmark-UCGDKMDF.js} +1 -1
- package/dist/{workspace-intelligence-runner-FXFSTCHC.js → workspace-intelligence-runner-FPPKTSNK.js} +1 -1
- package/dist/{workspace-knowledge-graph-3564KQXT.js → workspace-knowledge-graph-WNQMNAVL.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-WHCGPBGS.js → workspace-knowledge-graph-query-3GPXGWYN.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-MTFTCVFF.js +1 -0
- package/dist/{workspace-mcp-serve-ZK46EZUD.js → workspace-mcp-serve-KSZ2O66S.js} +1 -1
- package/dist/{workspace-model-6UMQAGUK.js → workspace-model-5FA2636K.js} +1 -1
- package/dist/{workspace-onboarding-C57OQ7XZ.js → workspace-onboarding-RJMTHN7Z.js} +1 -1
- package/dist/{workspace-registry-summary-GLQO4ZUF.js → workspace-registry-summary-WKENOFEA.js} +1 -1
- package/dist/workspace-repair-engine-4JTNNDZL.js +3 -0
- package/dist/workspace-run-HFOY2UYT.js +1 -0
- package/dist/{workspace-verify-LQHXBH2D.js → workspace-verify-37QL2JYE.js} +1 -1
- package/dist/{workspace-watch-Z32443UP.js → workspace-watch-P5X6TAFK.js} +1 -1
- package/docs/README.md +5 -2
- package/docs/README_CONTENT_CONTRACT.md +14 -9
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +53 -34
- package/docs/contracts/ARTIFACT_CATALOG.md +4 -1
- package/docs/doctor-command.md +13 -0
- package/docs/native-kit-baselines.md +82 -0
- package/docs/workspace-knowledge-graph.md +17 -2
- package/docs/workspace-repair-engine.md +9 -1
- package/docs/workspace-run.md +29 -0
- package/package.json +1 -1
- package/dist/analyze-OGWDSPXQ.js +0 -1
- package/dist/autopilot-release-QQDFEPT7.js +0 -1
- package/dist/chunk-DWL3PPLA.js +0 -1
- package/dist/chunk-EZPLMAW2.js +0 -1
- package/dist/chunk-IHKG5C6G.js +0 -1
- package/dist/chunk-IRLKWRLP.js +0 -3
- package/dist/chunk-TKXRP2B4.js +0 -1
- package/dist/chunk-U5ENEDJA.js +0 -7
- package/dist/chunk-WCJU3CFG.js +0 -1
- package/dist/chunk-XSSNM4F5.js +0 -5
- package/dist/verified-goal-YNSBL7L3.js +0 -1
- package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-P27RPMV5.js +0 -1
- package/dist/workspace-repair-engine-5ZSSF3T5.js +0 -3
- package/dist/workspace-run-UGWGT3K2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c
|
|
1
|
+
import {c,b as b$1,e,d,f,g,h as h$1,a as a$1}from'./chunk-HV6EQMUJ.js';import {h}from'./chunk-PKKSRXUS.js';import {b as b$2,a}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import u from'path';import o from'chalk';import b from'ora';import {execa}from'execa';function G(e){return `package main
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"context"
|
|
@@ -65,17 +65,17 @@ func main() {
|
|
|
65
65
|
}
|
|
66
66
|
slog.Info("server stopped")
|
|
67
67
|
}
|
|
68
|
-
`}function
|
|
68
|
+
`}function q(e){return `module ${e.module_path}
|
|
69
69
|
|
|
70
70
|
go ${e.go_version}
|
|
71
71
|
|
|
72
72
|
require (
|
|
73
|
-
github.com/gin-gonic/gin
|
|
74
|
-
github.com/swaggo/files
|
|
75
|
-
github.com/swaggo/gin-swagger
|
|
76
|
-
github.com/swaggo/swag
|
|
73
|
+
github.com/gin-gonic/gin ${a$1.go.gin}
|
|
74
|
+
github.com/swaggo/files ${a$1.go.swagFiles}
|
|
75
|
+
github.com/swaggo/gin-swagger ${a$1.go.ginSwagger}
|
|
76
|
+
github.com/swaggo/swag ${a$1.go.swag}
|
|
77
77
|
)
|
|
78
|
-
`}function
|
|
78
|
+
`}function E(e){return `package config
|
|
79
79
|
|
|
80
80
|
import (
|
|
81
81
|
"log/slog"
|
|
@@ -130,7 +130,7 @@ func getEnv(key, fallback string) string {
|
|
|
130
130
|
}
|
|
131
131
|
return fallback
|
|
132
132
|
}
|
|
133
|
-
`}function
|
|
133
|
+
`}function L(e){return `package server
|
|
134
134
|
|
|
135
135
|
import (
|
|
136
136
|
"net/http"
|
|
@@ -182,7 +182,7 @@ func NewRouter(cfg *config.Config) *gin.Engine {
|
|
|
182
182
|
|
|
183
183
|
return r
|
|
184
184
|
}
|
|
185
|
-
`}function
|
|
185
|
+
`}function C(){return `package handlers
|
|
186
186
|
|
|
187
187
|
import (
|
|
188
188
|
"net/http"
|
|
@@ -221,7 +221,7 @@ func Readiness(c *gin.Context) {
|
|
|
221
221
|
"time": time.Now().UTC().Format(time.RFC3339),
|
|
222
222
|
})
|
|
223
223
|
}
|
|
224
|
-
`}function
|
|
224
|
+
`}function y(e){return `package handlers_test
|
|
225
225
|
|
|
226
226
|
import (
|
|
227
227
|
"encoding/json"
|
|
@@ -266,8 +266,8 @@ func TestReadiness(t *testing.T) {
|
|
|
266
266
|
t.Fatalf("expected 200, got %d: %s", w.Code, w.Body.String())
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
`}function
|
|
270
|
-
FROM golang
|
|
269
|
+
`}function I(){return `# \u2500\u2500 Build stage \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
270
|
+
FROM golang:${a$1.go.version}-alpine AS builder
|
|
271
271
|
|
|
272
272
|
# Build-time version injection
|
|
273
273
|
ARG VERSION=dev
|
|
@@ -285,7 +285,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build \\
|
|
|
285
285
|
|
|
286
286
|
# \u2500\u2500 Runtime stage \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
287
287
|
# alpine includes busybox wget required for the HEALTHCHECK below.
|
|
288
|
-
FROM alpine
|
|
288
|
+
FROM alpine:${a$1.go.alpine}
|
|
289
289
|
|
|
290
290
|
RUN addgroup -S app && adduser -S -G app app
|
|
291
291
|
COPY --from=builder /app/server /server
|
|
@@ -295,7 +295,7 @@ EXPOSE 8080
|
|
|
295
295
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
296
296
|
CMD wget -qO- http://localhost:8080/api/v1/health/live || exit 1
|
|
297
297
|
ENTRYPOINT ["/server"]
|
|
298
|
-
`}function
|
|
298
|
+
`}function k(e){return `version: "3.9"
|
|
299
299
|
|
|
300
300
|
services:
|
|
301
301
|
api:
|
|
@@ -311,7 +311,7 @@ services:
|
|
|
311
311
|
CORS_ALLOW_ORIGINS: "*"
|
|
312
312
|
RATE_LIMIT_RPS: "100"
|
|
313
313
|
restart: unless-stopped
|
|
314
|
-
`}function
|
|
314
|
+
`}function x(e){return f({projectName:e.project_name,devCommand:"GIN_MODE=debug $(GOBIN)/air",runCommand:"GIN_MODE=debug go run $(LDFLAGS) ./cmd/server",testCommand:"GIN_MODE=test go test ./... -v -race",includeLintAndFmt:true})}function A(e){return `# Application
|
|
315
315
|
PORT=${e.port}
|
|
316
316
|
APP_ENV=development
|
|
317
317
|
GIN_MODE=debug
|
|
@@ -322,7 +322,7 @@ CORS_ALLOW_ORIGINS=*
|
|
|
322
322
|
|
|
323
323
|
# Rate limiting \u2014 max requests per IP per second
|
|
324
324
|
RATE_LIMIT_RPS=100
|
|
325
|
-
`}function
|
|
325
|
+
`}function M(){return `# Binaries
|
|
326
326
|
bin/
|
|
327
327
|
*.exe
|
|
328
328
|
*.exe~
|
|
@@ -362,7 +362,7 @@ docs/docs.go
|
|
|
362
362
|
# OS
|
|
363
363
|
.DS_Store
|
|
364
364
|
Thumbs.db
|
|
365
|
-
`}function
|
|
365
|
+
`}function P(e){return `name: CI
|
|
366
366
|
|
|
367
367
|
on:
|
|
368
368
|
push:
|
|
@@ -370,16 +370,19 @@ on:
|
|
|
370
370
|
pull_request:
|
|
371
371
|
branches: [main]
|
|
372
372
|
|
|
373
|
+
permissions:
|
|
374
|
+
contents: read
|
|
375
|
+
|
|
373
376
|
jobs:
|
|
374
377
|
test:
|
|
375
378
|
name: Test
|
|
376
379
|
runs-on: ubuntu-latest
|
|
377
380
|
|
|
378
381
|
steps:
|
|
379
|
-
- uses: actions/checkout
|
|
382
|
+
- uses: actions/checkout@${a$1.actions.checkout}
|
|
380
383
|
|
|
381
384
|
- name: Set up Go
|
|
382
|
-
uses: actions/setup-go
|
|
385
|
+
uses: actions/setup-go@${a$1.actions.setupGo}
|
|
383
386
|
with:
|
|
384
387
|
go-version: "${e.go_version}"
|
|
385
388
|
cache: true
|
|
@@ -394,7 +397,7 @@ jobs:
|
|
|
394
397
|
run: GIN_MODE=test go test ./... -race -coverprofile=coverage.out
|
|
395
398
|
|
|
396
399
|
- name: Upload coverage
|
|
397
|
-
uses: actions/upload-artifact
|
|
400
|
+
uses: actions/upload-artifact@${a$1.actions.uploadArtifact}
|
|
398
401
|
with:
|
|
399
402
|
name: coverage
|
|
400
403
|
path: coverage.out
|
|
@@ -404,19 +407,19 @@ jobs:
|
|
|
404
407
|
runs-on: ubuntu-latest
|
|
405
408
|
|
|
406
409
|
steps:
|
|
407
|
-
- uses: actions/checkout
|
|
410
|
+
- uses: actions/checkout@${a$1.actions.checkout}
|
|
408
411
|
|
|
409
412
|
- name: Set up Go
|
|
410
|
-
uses: actions/setup-go
|
|
413
|
+
uses: actions/setup-go@${a$1.actions.setupGo}
|
|
411
414
|
with:
|
|
412
415
|
go-version: "${e.go_version}"
|
|
413
416
|
cache: true
|
|
414
417
|
|
|
415
418
|
- name: golangci-lint
|
|
416
|
-
uses: golangci/golangci-lint-action
|
|
419
|
+
uses: golangci/golangci-lint-action@${a$1.actions.golangciLint}
|
|
417
420
|
with:
|
|
418
|
-
version:
|
|
419
|
-
`}function
|
|
421
|
+
version: ${a$1.go.golangciLint}
|
|
422
|
+
`}function D(e){return `# ${d(e.project_name)}
|
|
420
423
|
|
|
421
424
|
> ${e.description}
|
|
422
425
|
|
|
@@ -532,7 +535,7 @@ ${e.project_name}/
|
|
|
532
535
|
## License
|
|
533
536
|
|
|
534
537
|
${e.app_version} \xB7 ${e.author}
|
|
535
|
-
`}function
|
|
538
|
+
`}function H(){return `package middleware
|
|
536
539
|
|
|
537
540
|
import (
|
|
538
541
|
"crypto/rand"
|
|
@@ -584,7 +587,7 @@ func newID() string {
|
|
|
584
587
|
}
|
|
585
588
|
return hex.EncodeToString(b)
|
|
586
589
|
}
|
|
587
|
-
`}function
|
|
590
|
+
`}function F(e){return `package middleware_test
|
|
588
591
|
|
|
589
592
|
import (
|
|
590
593
|
"net/http"
|
|
@@ -633,7 +636,7 @@ func TestRequestID_IsReused(t *testing.T) {
|
|
|
633
636
|
t.Fatalf("expected X-Request-ID to be reused, got %q", id)
|
|
634
637
|
}
|
|
635
638
|
}
|
|
636
|
-
`}function
|
|
639
|
+
`}function $(){return `// Package apierr provides a consistent JSON error envelope for all API responses.
|
|
637
640
|
//
|
|
638
641
|
// Every error response looks like:
|
|
639
642
|
//
|
|
@@ -696,7 +699,7 @@ func InternalError(c *gin.Context, _ error) {
|
|
|
696
699
|
func TooManyRequests(c *gin.Context) {
|
|
697
700
|
reply(c, http.StatusTooManyRequests, "rate limit exceeded", "TOO_MANY_REQUESTS")
|
|
698
701
|
}
|
|
699
|
-
`}function
|
|
702
|
+
`}function j(e){return `package apierr_test
|
|
700
703
|
|
|
701
704
|
import (
|
|
702
705
|
"encoding/json"
|
|
@@ -822,11 +825,11 @@ func TestTooManyRequests(t *testing.T) {
|
|
|
822
825
|
t.Fatalf("expected TOO_MANY_REQUESTS, got %q", body.Code)
|
|
823
826
|
}
|
|
824
827
|
}
|
|
825
|
-
`}function
|
|
828
|
+
`}function U(e){return `// Package docs provides the swaggo-generated OpenAPI specification.
|
|
826
829
|
//
|
|
827
830
|
// Run \`make docs\` to regenerate after changing handler annotations.
|
|
828
831
|
//
|
|
829
|
-
// @title ${
|
|
832
|
+
// @title ${d(e.project_name)} API
|
|
830
833
|
// @version ${e.app_version}
|
|
831
834
|
// @description ${e.description}
|
|
832
835
|
// @host localhost:${e.port}
|
|
@@ -836,7 +839,7 @@ func TestTooManyRequests(t *testing.T) {
|
|
|
836
839
|
// @contact.name ${e.author}
|
|
837
840
|
// @license.name MIT
|
|
838
841
|
package docs
|
|
839
|
-
`}function
|
|
842
|
+
`}function B(e){return `package handlers
|
|
840
843
|
|
|
841
844
|
import (
|
|
842
845
|
"net/http"
|
|
@@ -878,7 +881,7 @@ func EchoParams(c *gin.Context) {
|
|
|
878
881
|
RequestID: c.GetString("X-Request-ID"),
|
|
879
882
|
})
|
|
880
883
|
}
|
|
881
|
-
`}function
|
|
884
|
+
`}function V(e){return `package handlers_test
|
|
882
885
|
|
|
883
886
|
import (
|
|
884
887
|
"encoding/json"
|
|
@@ -943,7 +946,7 @@ func TestEchoParams_EmptyName(t *testing.T) {
|
|
|
943
946
|
t.Fatalf("expected code=BAD_REQUEST, got %v", body["code"])
|
|
944
947
|
}
|
|
945
948
|
}
|
|
946
|
-
`}function
|
|
949
|
+
`}function W(e){return `package config_test
|
|
947
950
|
|
|
948
951
|
import (
|
|
949
952
|
"log/slog"
|
|
@@ -1019,7 +1022,7 @@ func TestLoad_Defaults(t *testing.T) {
|
|
|
1019
1022
|
t.Errorf("expected default GinMode=debug, got %q", cfg.GinMode)
|
|
1020
1023
|
}
|
|
1021
1024
|
}
|
|
1022
|
-
`}function
|
|
1025
|
+
`}function J(){return `package middleware
|
|
1023
1026
|
|
|
1024
1027
|
import (
|
|
1025
1028
|
"net/http"
|
|
@@ -1067,7 +1070,7 @@ func CORS() gin.HandlerFunc {
|
|
|
1067
1070
|
c.Next()
|
|
1068
1071
|
}
|
|
1069
1072
|
}
|
|
1070
|
-
`}function
|
|
1073
|
+
`}function K(e){return `package middleware_test
|
|
1071
1074
|
|
|
1072
1075
|
import (
|
|
1073
1076
|
"net/http"
|
|
@@ -1153,7 +1156,7 @@ func TestCORS_Default_Origin(t *testing.T) {
|
|
|
1153
1156
|
t.Fatal("expected CORS header when CORS_ALLOW_ORIGINS defaults to *")
|
|
1154
1157
|
}
|
|
1155
1158
|
}
|
|
1156
|
-
`}function
|
|
1159
|
+
`}function X(e){return `package server_test
|
|
1157
1160
|
|
|
1158
1161
|
import (
|
|
1159
1162
|
"encoding/json"
|
|
@@ -1263,7 +1266,7 @@ func TestServer_ReleaseMode(t *testing.T) {
|
|
|
1263
1266
|
t.Fatalf("expected 200 in release mode, got %d", w.Code)
|
|
1264
1267
|
}
|
|
1265
1268
|
}
|
|
1266
|
-
`}function
|
|
1269
|
+
`}function Q(e){return `package middleware
|
|
1267
1270
|
|
|
1268
1271
|
import (
|
|
1269
1272
|
"os"
|
|
@@ -1314,7 +1317,7 @@ func RateLimit() gin.HandlerFunc {
|
|
|
1314
1317
|
c.Next()
|
|
1315
1318
|
}
|
|
1316
1319
|
}
|
|
1317
|
-
`}function
|
|
1320
|
+
`}function Y(e){return `package middleware_test
|
|
1318
1321
|
|
|
1319
1322
|
import (
|
|
1320
1323
|
"net/http"
|
|
@@ -1383,7 +1386,7 @@ func TestRateLimit_InvalidRPS(t *testing.T) {
|
|
|
1383
1386
|
t.Fatalf("expected 200 with invalid RPS env, got %d", w.Code)
|
|
1384
1387
|
}
|
|
1385
1388
|
}
|
|
1386
|
-
`}function
|
|
1389
|
+
`}function z(e){return `# Air \u2014 live reload for Go projects
|
|
1387
1390
|
# https://github.com/air-verse/air
|
|
1388
1391
|
root = "."
|
|
1389
1392
|
tmp_dir = "tmp"
|
|
@@ -1408,19 +1411,19 @@ tmp_dir = "tmp"
|
|
|
1408
1411
|
|
|
1409
1412
|
[log]
|
|
1410
1413
|
time = false
|
|
1411
|
-
`}function
|
|
1414
|
+
`}function Z(e){return `version: "2"
|
|
1415
|
+
|
|
1416
|
+
run:
|
|
1412
1417
|
timeout: 5m
|
|
1413
1418
|
|
|
1414
1419
|
linters:
|
|
1420
|
+
default: standard
|
|
1415
1421
|
enable:
|
|
1416
1422
|
- bodyclose
|
|
1417
1423
|
- durationcheck
|
|
1418
1424
|
- errcheck
|
|
1419
1425
|
- errname
|
|
1420
1426
|
- errorlint
|
|
1421
|
-
- gci
|
|
1422
|
-
- goimports
|
|
1423
|
-
- gosimple
|
|
1424
1427
|
- govet
|
|
1425
1428
|
- ineffassign
|
|
1426
1429
|
- misspell
|
|
@@ -1431,29 +1434,37 @@ linters:
|
|
|
1431
1434
|
- unconvert
|
|
1432
1435
|
- unused
|
|
1433
1436
|
- wrapcheck
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1437
|
+
settings:
|
|
1438
|
+
govet:
|
|
1439
|
+
enable:
|
|
1440
|
+
- shadow
|
|
1441
|
+
wrapcheck:
|
|
1442
|
+
ignore-package-globs:
|
|
1443
|
+
- "${e}/*"
|
|
1444
|
+
exclusions:
|
|
1445
|
+
rules:
|
|
1446
|
+
- path: _test\\.go
|
|
1447
|
+
linters:
|
|
1448
|
+
- errcheck
|
|
1449
|
+
- wrapcheck
|
|
1450
|
+
|
|
1451
|
+
formatters:
|
|
1452
|
+
enable:
|
|
1453
|
+
- gci
|
|
1454
|
+
- goimports
|
|
1455
|
+
settings:
|
|
1456
|
+
gci:
|
|
1457
|
+
sections:
|
|
1458
|
+
- standard
|
|
1459
|
+
- default
|
|
1460
|
+
- prefix(${e})
|
|
1461
|
+
goimports:
|
|
1462
|
+
local-prefixes:
|
|
1463
|
+
- "${e}"
|
|
1449
1464
|
|
|
1450
1465
|
issues:
|
|
1451
1466
|
max-same-issues: 5
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
- wrapcheck
|
|
1457
|
-
`}function Y(){return JSON.stringify({engine:"npm",runtime:"go"},null,2)}function Z(e,n){return JSON.stringify({kit_name:"gogin.standard",runtime:"go",module_support:false,project_name:e.project_name,module_path:e.module_path,app_version:e.app_version,created_by:"workspai",workspai_version:n,rapidkit_version:n,created_at:new Date().toISOString()},null,2)}function ee(e$1){return e({runtimeLabel:"Go/Gin",projectName:e$1.project_name,fallbackDevCommand:'cd "$SCRIPT_DIR" && GIN_MODE=debug exec go run ./cmd/server "$@"'})}function te(e){return f({runtimeLabel:"Go/Gin",projectName:e.project_name})}async function ge(e,n){let r={project_name:n.project_name,module_path:n.module_path||n.project_name,author:n.author||"Workspai User",description:n.description||`Go/Gin REST API \u2014 ${n.project_name}`,go_version:n.go_version||a$1,app_version:n.app_version||"0.1.0",port:n.port||"8080",skipGit:n.skipGit??false,skipInstall:n.skipInstall??false},R=h();if(!r.skipInstall)try{await execa("go",["version"],{timeout:3e3});}catch{console.log(o.yellow("\n\u26A0 Go not found in PATH \u2014 project will be scaffolded, but `go mod tidy` requires Go 1.21+")),console.log(o.gray(` Install: https://go.dev/dl/
|
|
1458
|
-
`));}let i=O(`Generating Go/Gin project: ${r.project_name}\u2026`).start();try{let t=(_,T)=>c$1(c.join(e,_),T),v=c.join(e,"rapidkit"),S=c.join(e,"rapidkit.cmd");if(await Promise.all([t("cmd/server/main.go",N(r)),t("go.mod",b(r)),t("internal/config/config.go",G(r)),t("internal/server/server.go",q(r)),t("internal/middleware/requestid.go",P()),t("internal/middleware/requestid_test.go",D(r)),t("internal/apierr/apierr.go",H()),t("internal/apierr/apierr_test.go",F(r)),t("internal/handlers/health.go",E()),t("internal/handlers/health_test.go",C(r)),t("internal/handlers/example.go",j(r)),t("internal/handlers/example_test.go",U(r)),t("internal/config/config_test.go",B(r)),t("internal/middleware/cors.go",V()),t("internal/middleware/cors_test.go",W(r)),t("internal/middleware/ratelimit.go",K(r)),t("internal/middleware/ratelimit_test.go",X(r)),t("internal/server/server_test.go",J(r)),t("docs/doc.go",$(r)),t(".air.toml",Q(r)),t("Dockerfile",L()),t("docker-compose.yml",y(r)),t("Makefile",I(r)),t(".golangci.yml",z(r.module_path)),t(".env.example",k(r)),t(".gitignore",x()),t(".github/workflows/ci.yml",M(r)),t("README.md",A(r)),t(".workspai/project.json",Z(r,R)),t(".workspai/context.json",Y()),t("rapidkit",ee(r)),t("rapidkit.cmd",te(r))]),await promises.chmod(v,493),await promises.chmod(S,493),i.succeed(o.green(`Project created at ${e}`)),r.skipInstall)i.info(o.gray("Skipped Go dependency warm-up (--skip-install)."));else try{i.start("Fetching Go dependencies\u2026"),await execa("go",["mod","tidy"],{cwd:e,timeout:12e4}),i.succeed(o.gray("\u2713 go mod tidy completed"));}catch{i.warn(o.yellow("\u26A0 go mod tidy failed \u2014 run manually: go mod tidy"));}if(!r.skipGit)try{await b$1(e)?console.log(o.gray("\u26A0 git init skipped (target is inside an existing git worktree)")):(await execa("git",["init"],{cwd:e,env:a()}),await execa("git",["add","-A"],{cwd:e,env:a()}),await execa("git",["commit","-m","chore: initial scaffold (rapidkit gogin.standard)"],{cwd:e,env:a()}),console.log(o.gray("\u2713 git repository initialized")));}catch{console.log(o.gray("\u26A0 git init skipped (git not found or error)"));}console.log(""),console.log(o.bold("\u2705 Go/Gin project ready!")),console.log(""),console.log(o.cyan("Next steps:")),console.log(o.white(` cd ${r.project_name}`)),console.log(o.white(" make run # start dev server")),console.log(o.white(" make test # run tests")),console.log(""),console.log(o.gray("Server will listen on port "+r.port)),console.log(o.gray(" http://localhost:"+r.port+"/api/v1/health/live")),console.log(o.gray(" http://localhost:"+r.port+"/api/v1/health/ready")),console.log(""),console.log(o.yellow("\u2139 RapidKit Core modules are not available for Go projects (module system uses Python/pip).")),console.log("");}catch(t){throw i.fail(o.red("Failed to generate Go/Gin project")),t}}
|
|
1459
|
-
export{ge as generateGoGinKit};
|
|
1467
|
+
`}function ee(){return JSON.stringify({engine:"npm",runtime:"go"},null,2)}function te(e,n){return JSON.stringify({kit_name:"gogin.standard",runtime:"go",module_support:false,project_name:e.project_name,module_path:e.module_path,app_version:e.app_version,created_by:"workspai",workspai_version:n,rapidkit_version:n,created_at:new Date().toISOString()},null,2)}function re(e){return g({runtimeLabel:"Go/Gin",projectName:e.project_name,fallbackDevCommand:'cd "$SCRIPT_DIR" && GIN_MODE=debug exec go run ./cmd/server "$@"'})}function oe(e){return h$1({runtimeLabel:"Go/Gin",projectName:e.project_name})}async function me(e$1,n){let r={project_name:n.project_name,module_path:n.module_path||n.project_name,author:n.author||"Workspai User",description:n.description||`Go/Gin REST API \u2014 ${n.project_name}`,go_version:n.go_version||c,app_version:n.app_version||"0.1.0",port:n.port||"8080",skipGit:n.skipGit??false,skipInstall:n.skipInstall??false},S=h();if(!r.skipInstall)try{await execa("go",["version"],{timeout:3e3});}catch{console.log(o.yellow(`
|
|
1468
|
+
\u26A0 Go not found in PATH \u2014 project will be scaffolded, but this baseline requires Go ${c}+`)),console.log(o.gray(` Install: https://go.dev/dl/
|
|
1469
|
+
`));}let a$1=b(`Generating Go/Gin project: ${r.project_name}\u2026`).start();try{let t=(N,O)=>e(u.join(e$1,N),O),_=u.join(e$1,"rapidkit"),T=u.join(e$1,"rapidkit.cmd");if(await Promise.all([t("cmd/server/main.go",G(r)),t("go.mod",q(r)),t("internal/config/config.go",E(r)),t("internal/server/server.go",L(r)),t("internal/middleware/requestid.go",H()),t("internal/middleware/requestid_test.go",F(r)),t("internal/apierr/apierr.go",$()),t("internal/apierr/apierr_test.go",j(r)),t("internal/handlers/health.go",C()),t("internal/handlers/health_test.go",y(r)),t("internal/handlers/example.go",B(r)),t("internal/handlers/example_test.go",V(r)),t("internal/config/config_test.go",W(r)),t("internal/middleware/cors.go",J()),t("internal/middleware/cors_test.go",K(r)),t("internal/middleware/ratelimit.go",Q(r)),t("internal/middleware/ratelimit_test.go",Y(r)),t("internal/server/server_test.go",X(r)),t("docs/doc.go",U(r)),t(".air.toml",z(r)),t("Dockerfile",I()),t("docker-compose.yml",k(r)),t("Makefile",x(r)),t(".golangci.yml",Z(r.module_path)),t(".env.example",A(r)),t(".gitignore",M()),t(".github/workflows/ci.yml",P(r)),t(".github/dependabot.yml",b$1("gomod")),t("README.md",D(r)),t(".workspai/project.json",te(r,S)),t(".workspai/context.json",ee()),t("rapidkit",re(r)),t("rapidkit.cmd",oe(r))]),await promises.chmod(_,493),await promises.chmod(T,493),a$1.succeed(o.green(`Project created at ${e$1}`)),r.skipInstall)a$1.info(o.gray("Skipped Go dependency warm-up (--skip-install)."));else try{a$1.start("Fetching Go dependencies\u2026"),await execa("go",["mod","tidy"],{cwd:e$1,timeout:12e4}),a$1.succeed(o.gray("\u2713 go mod tidy completed"));}catch{a$1.warn(o.yellow("\u26A0 go mod tidy failed \u2014 run manually: go mod tidy"));}if(!r.skipGit)try{await b$2(e$1)?console.log(o.gray("\u26A0 git init skipped (target is inside an existing git worktree)")):(await execa("git",["init"],{cwd:e$1,env:a()}),await execa("git",["add","-A"],{cwd:e$1,env:a()}),await execa("git",["commit","-m","chore: initial scaffold (rapidkit gogin.standard)"],{cwd:e$1,env:a()}),console.log(o.gray("\u2713 git repository initialized")));}catch{console.log(o.gray("\u26A0 git init skipped (git not found or error)"));}console.log(""),console.log(o.bold("\u2705 Go/Gin project ready!")),console.log(""),console.log(o.cyan("Next steps:")),console.log(o.white(` cd ${r.project_name}`)),console.log(o.white(" make run # start dev server")),console.log(o.white(" make test # run tests")),console.log(""),console.log(o.gray("Server will listen on port "+r.port)),console.log(o.gray(" http://localhost:"+r.port+"/api/v1/health/live")),console.log(o.gray(" http://localhost:"+r.port+"/api/v1/health/ready")),console.log(""),console.log(o.yellow("\u2139 RapidKit Core modules are not available for Go projects (module system uses Python/pip).")),console.log("");}catch(t){throw a$1.fail(o.red("Failed to generate Go/Gin project")),t}}
|
|
1470
|
+
export{me as generateGoGinKit};
|