@kindgi/cli 0.1.4-rc.5 → 0.1.5-rc.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 +16 -10
- package/dist/build/defaults.d.ts +3 -1
- package/dist/build/defaults.d.ts.map +1 -1
- package/dist/build/defaults.js +44 -1
- package/dist/build/defaults.js.map +1 -1
- package/dist/build/java-image.d.ts +31 -0
- package/dist/build/java-image.d.ts.map +1 -0
- package/dist/build/java-image.js +146 -0
- package/dist/build/java-image.js.map +1 -0
- package/dist/build/pack-root.d.ts +1 -31
- package/dist/build/pack-root.d.ts.map +1 -1
- package/dist/build/pack-root.js +22 -2
- package/dist/build/pack-root.js.map +1 -1
- package/dist/build/runners.d.ts +44 -0
- package/dist/build/runners.d.ts.map +1 -1
- package/dist/build/scala-image.d.ts +21 -0
- package/dist/build/scala-image.d.ts.map +1 -0
- package/dist/build/scala-image.js +150 -0
- package/dist/build/scala-image.js.map +1 -0
- package/dist/cli-pin.d.ts +16 -0
- package/dist/cli-pin.d.ts.map +1 -0
- package/dist/cli-pin.js +66 -0
- package/dist/cli-pin.js.map +1 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +9 -8
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/approvals.d.ts.map +1 -1
- package/dist/commands/approvals.js +30 -4
- package/dist/commands/approvals.js.map +1 -1
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +100 -37
- package/dist/commands/artifacts.js.map +1 -1
- package/dist/commands/auth.js +2 -2
- package/dist/commands/blocks.d.ts.map +1 -1
- package/dist/commands/blocks.js +5 -4
- package/dist/commands/blocks.js.map +1 -1
- package/dist/commands/build.d.ts +10 -2
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +109 -16
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/capabilities.d.ts.map +1 -1
- package/dist/commands/capabilities.js +37 -10
- package/dist/commands/capabilities.js.map +1 -1
- package/dist/commands/console.d.ts +21 -0
- package/dist/commands/console.d.ts.map +1 -0
- package/dist/commands/console.js +87 -0
- package/dist/commands/console.js.map +1 -0
- package/dist/commands/conversations.d.ts.map +1 -1
- package/dist/commands/conversations.js +13 -2
- package/dist/commands/conversations.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +11 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +211 -39
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +18 -5
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +421 -21
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env-scoped.d.ts +44 -0
- package/dist/commands/env-scoped.d.ts.map +1 -0
- package/dist/commands/env-scoped.js +222 -0
- package/dist/commands/env-scoped.js.map +1 -0
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +85 -123
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/eval-runs.d.ts +9 -0
- package/dist/commands/eval-runs.d.ts.map +1 -1
- package/dist/commands/eval-runs.js +20 -19
- package/dist/commands/eval-runs.js.map +1 -1
- package/dist/commands/eval-suites.d.ts.map +1 -1
- package/dist/commands/eval-suites.js +16 -8
- package/dist/commands/eval-suites.js.map +1 -1
- package/dist/commands/exports.d.ts +3 -0
- package/dist/commands/exports.d.ts.map +1 -0
- package/dist/commands/exports.js +82 -0
- package/dist/commands/exports.js.map +1 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +6 -5
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/flows.d.ts.map +1 -1
- package/dist/commands/flows.js +2 -1
- package/dist/commands/flows.js.map +1 -1
- package/dist/commands/gate-policies.d.ts.map +1 -1
- package/dist/commands/gate-policies.js +2 -1
- package/dist/commands/gate-policies.js.map +1 -1
- package/dist/commands/guardrails.d.ts.map +1 -1
- package/dist/commands/guardrails.js +3 -2
- package/dist/commands/guardrails.js.map +1 -1
- package/dist/commands/helpers.js +5 -5
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +14 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +254 -18
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/judge-classes.d.ts.map +1 -1
- package/dist/commands/judge-classes.js +11 -10
- package/dist/commands/judge-classes.js.map +1 -1
- package/dist/commands/judgments.d.ts.map +1 -1
- package/dist/commands/judgments.js +7 -6
- package/dist/commands/judgments.js.map +1 -1
- package/dist/commands/key.js +4 -4
- package/dist/commands/memory.d.ts.map +1 -1
- package/dist/commands/memory.js +277 -25
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/people.d.ts +3 -0
- package/dist/commands/people.d.ts.map +1 -0
- package/dist/commands/people.js +166 -0
- package/dist/commands/people.js.map +1 -0
- package/dist/commands/proposals.d.ts.map +1 -1
- package/dist/commands/proposals.js +390 -69
- package/dist/commands/proposals.js.map +1 -1
- package/dist/commands/provenance.d.ts.map +1 -1
- package/dist/commands/provenance.js +6 -7
- package/dist/commands/provenance.js.map +1 -1
- package/dist/commands/providers.d.ts.map +1 -1
- package/dist/commands/providers.js +46 -7
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/reviewers.d.ts.map +1 -1
- package/dist/commands/reviewers.js +3 -2
- package/dist/commands/reviewers.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +24 -14
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/schedules.d.ts +3 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +275 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/secrets.d.ts.map +1 -1
- package/dist/commands/secrets.js +10 -11
- package/dist/commands/secrets.js.map +1 -1
- package/dist/commands/service-accounts.d.ts +3 -0
- package/dist/commands/service-accounts.d.ts.map +1 -0
- package/dist/commands/service-accounts.js +175 -0
- package/dist/commands/service-accounts.js.map +1 -0
- package/dist/commands/skills.d.ts +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +11 -4
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/sso.d.ts +6 -0
- package/dist/commands/sso.d.ts.map +1 -0
- package/dist/commands/sso.js +318 -0
- package/dist/commands/sso.js.map +1 -0
- package/dist/commands/tokens.d.ts +11 -0
- package/dist/commands/tokens.d.ts.map +1 -1
- package/dist/commands/tokens.js +144 -11
- package/dist/commands/tokens.js.map +1 -1
- package/dist/commands/tools.d.ts.map +1 -1
- package/dist/commands/tools.js +4 -3
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/unwired.d.ts.map +1 -1
- package/dist/commands/unwired.js +1 -30
- package/dist/commands/unwired.js.map +1 -1
- package/dist/commands/upgrade.d.ts +11 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +160 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/context.d.ts +7 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -0
- package/dist/context.js.map +1 -1
- package/dist/dev/defaults.d.ts +28 -11
- package/dist/dev/defaults.d.ts.map +1 -1
- package/dist/dev/defaults.js +114 -35
- package/dist/dev/defaults.js.map +1 -1
- package/dist/dev/google-credentials.d.ts +50 -0
- package/dist/dev/google-credentials.d.ts.map +1 -0
- package/dist/dev/google-credentials.js +157 -0
- package/dist/dev/google-credentials.js.map +1 -0
- package/dist/dev/java-builder.d.ts +56 -0
- package/dist/dev/java-builder.d.ts.map +1 -0
- package/dist/dev/java-builder.js +204 -0
- package/dist/dev/java-builder.js.map +1 -0
- package/dist/dev/jvm-run-files.d.ts +29 -0
- package/dist/dev/jvm-run-files.d.ts.map +1 -0
- package/dist/dev/jvm-run-files.js +94 -0
- package/dist/dev/jvm-run-files.js.map +1 -0
- package/dist/dev/lines.d.ts +13 -0
- package/dist/dev/lines.d.ts.map +1 -0
- package/dist/dev/lines.js +24 -0
- package/dist/dev/lines.js.map +1 -0
- package/dist/dev/log-view.d.ts +116 -0
- package/dist/dev/log-view.d.ts.map +1 -0
- package/dist/dev/log-view.js +233 -0
- package/dist/dev/log-view.js.map +1 -0
- package/dist/dev/pack-code.d.ts +79 -4
- package/dist/dev/pack-code.d.ts.map +1 -1
- package/dist/dev/pack-code.js +262 -3
- package/dist/dev/pack-code.js.map +1 -1
- package/dist/dev/pack-env.d.ts.map +1 -1
- package/dist/dev/pack-env.js +4 -0
- package/dist/dev/pack-env.js.map +1 -1
- package/dist/dev/pack-service.d.ts +11 -1
- package/dist/dev/pack-service.d.ts.map +1 -1
- package/dist/dev/pack-service.js +56 -20
- package/dist/dev/pack-service.js.map +1 -1
- package/dist/dev/paths.d.ts +6 -0
- package/dist/dev/paths.d.ts.map +1 -1
- package/dist/dev/paths.js +8 -0
- package/dist/dev/paths.js.map +1 -1
- package/dist/dev/project-database.js +1 -1
- package/dist/dev/project-database.js.map +1 -1
- package/dist/dev/runners.d.ts +35 -9
- package/dist/dev/runners.d.ts.map +1 -1
- package/dist/dev/runtime-container.d.ts +10 -2
- package/dist/dev/runtime-container.d.ts.map +1 -1
- package/dist/dev/runtime-container.js +48 -20
- package/dist/dev/runtime-container.js.map +1 -1
- package/dist/dev/runtime-env.d.ts +10 -0
- package/dist/dev/runtime-env.d.ts.map +1 -1
- package/dist/dev/runtime-env.js +8 -4
- package/dist/dev/runtime-env.js.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/dev/scala-builder.d.ts +72 -0
- package/dist/dev/scala-builder.d.ts.map +1 -0
- package/dist/dev/scala-builder.js +347 -0
- package/dist/dev/scala-builder.js.map +1 -0
- package/dist/env/project-env.d.ts.map +1 -1
- package/dist/env/project-env.js +3 -1
- package/dist/env/project-env.js.map +1 -1
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -1
- package/dist/help.d.ts +14 -0
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +55 -0
- package/dist/help.js.map +1 -1
- package/dist/init/dependency-specs.d.ts +26 -0
- package/dist/init/dependency-specs.d.ts.map +1 -1
- package/dist/init/dependency-specs.js +38 -0
- package/dist/init/dependency-specs.js.map +1 -1
- package/dist/init/java-augment.d.ts +24 -0
- package/dist/init/java-augment.d.ts.map +1 -0
- package/dist/init/java-augment.js +198 -0
- package/dist/init/java-augment.js.map +1 -0
- package/dist/init/mode-detect.d.ts +2 -2
- package/dist/init/mode-detect.d.ts.map +1 -1
- package/dist/init/mode-detect.js +12 -1
- package/dist/init/mode-detect.js.map +1 -1
- package/dist/init/scala-augment.d.ts +23 -0
- package/dist/init/scala-augment.d.ts.map +1 -0
- package/dist/init/scala-augment.js +213 -0
- package/dist/init/scala-augment.js.map +1 -0
- package/dist/init/template-files.d.ts +40 -2
- package/dist/init/template-files.d.ts.map +1 -1
- package/dist/init/template-files.js +56 -5
- package/dist/init/template-files.js.map +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +30 -4
- package/dist/main.js.map +1 -1
- package/dist/open-url.d.ts +15 -0
- package/dist/open-url.d.ts.map +1 -0
- package/dist/open-url.js +41 -0
- package/dist/open-url.js.map +1 -0
- package/dist/package-manager.d.ts +10 -3
- package/dist/package-manager.d.ts.map +1 -1
- package/dist/package-manager.js +19 -1
- package/dist/package-manager.js.map +1 -1
- package/dist/providers/preset-loader.d.ts.map +1 -1
- package/dist/providers/preset-loader.js +9 -1
- package/dist/providers/preset-loader.js.map +1 -1
- package/dist/providers/presets/anthropic.json +35 -4
- package/dist/providers/presets/gemini-api.json +3 -0
- package/dist/providers/presets/gemini.json +3 -0
- package/dist/providers/presets/groq.json +1 -0
- package/dist/providers/presets/openai.json +36 -4
- package/dist/providers/presets/openrouter.json +6 -2
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +28 -4
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +47 -3
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +7 -5
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +81 -52
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +27 -1
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +5 -4
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-java-authoring-agents/SKILL.md +220 -0
- package/dist/sdk-skills/kindgi-java-authoring-flows/SKILL.md +390 -0
- package/dist/sdk-skills/kindgi-java-authoring-guardrails/SKILL.md +209 -0
- package/dist/sdk-skills/kindgi-java-authoring-tools/SKILL.md +334 -0
- package/dist/sdk-skills/kindgi-java-getting-started/SKILL.md +270 -0
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +23 -5
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +10 -3
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +36 -5
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +2 -2
- package/dist/sdk-skills/kindgi-scala-authoring-agents/SKILL.md +217 -0
- package/dist/sdk-skills/kindgi-scala-authoring-flows/SKILL.md +357 -0
- package/dist/sdk-skills/kindgi-scala-authoring-guardrails/SKILL.md +199 -0
- package/dist/sdk-skills/kindgi-scala-authoring-tools/SKILL.md +302 -0
- package/dist/sdk-skills/kindgi-scala-getting-started/SKILL.md +302 -0
- package/dist/templates/java/.mvn/wrapper/maven-wrapper.properties +3 -0
- package/dist/templates/java/AGENTS.md +31 -0
- package/dist/templates/java/README.md.tmpl +69 -0
- package/dist/templates/java/gitignore +9 -0
- package/dist/templates/java/kindgi.config.json.tmpl +8 -0
- package/dist/templates/java/kindgiw +33 -0
- package/dist/templates/java/kindgiw.cmd +28 -0
- package/dist/templates/java/mvnw +295 -0
- package/dist/templates/java/pom.xml.tmpl +65 -0
- package/dist/templates/java/src/main/java/__PACKAGE__/agents/EchoAgent.java.tmpl +27 -0
- package/dist/templates/java/src/main/java/__PACKAGE__/flows/EchoFlow.java.tmpl +18 -0
- package/dist/templates/java/src/main/java/__PACKAGE__/guardrails/ResponseNotEmpty.java.tmpl +28 -0
- package/dist/templates/java/src/main/java/__PACKAGE__/tools/Echo.java.tmpl +22 -0
- package/dist/templates/java/src/main/java/__PACKAGE__/tools/Greet.java.tmpl +23 -0
- package/dist/templates/java/src/test/java/__PACKAGE__/ToolsTest.java.tmpl +30 -0
- package/dist/templates/minimal/README.md.tmpl +8 -14
- package/dist/templates/python/README.md.tmpl +6 -6
- package/dist/templates/sample/README.md.tmpl +7 -13
- package/dist/templates/scala/AGENTS.md +32 -0
- package/dist/templates/scala/README.md.tmpl +75 -0
- package/dist/templates/scala/build.sbt.tmpl +16 -0
- package/dist/templates/scala/gitignore +13 -0
- package/dist/templates/scala/kindgi.config.json.tmpl +8 -0
- package/dist/templates/scala/project/build.properties +1 -0
- package/dist/templates/scala/src/main/scala/__PACKAGE__/agents/EchoAgent.scala.tmpl +23 -0
- package/dist/templates/scala/src/main/scala/__PACKAGE__/flows/EchoFlow.scala.tmpl +16 -0
- package/dist/templates/scala/src/main/scala/__PACKAGE__/guardrails/ResponseNotEmpty.scala.tmpl +21 -0
- package/dist/templates/scala/src/main/scala/__PACKAGE__/tools/Echo.scala.tmpl +16 -0
- package/dist/templates/scala/src/main/scala/__PACKAGE__/tools/Greet.scala.tmpl +17 -0
- package/dist/templates/scala/src/test/scala/__PACKAGE__/ToolsSuite.scala.tmpl +23 -0
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAEL,KAAK,oBAAoB,EAK1B,MAAM,8BAA8B,CAAC;AA+BtC,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAEV,WAAW,EAKZ,MAAM,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D,eAAO,MAAM,UAAU,EAAE,WAqGxB,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAuH7C,wBAAsB,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAosBxE;AAgpBD,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AA+ED,UAAU,eAAe;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IAC3D,6DAA6D;IAC7D,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,kFAAkF;IAClF,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,mGAAmG;IACnG,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,uGAAuG;IACvG,QAAQ,CAAC,iBAAiB,CAAC,EAAE,oBAAoB,CAAC;CACnD;AA8CD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAKrE;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,MAAM,EAAE,CAoC1E"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -37,11 +37,13 @@ import { basename, isAbsolute, join, resolve } from 'node:path';
|
|
|
37
37
|
import { createInterface } from 'node:readline';
|
|
38
38
|
import { discoveryRoots, findKindgiConfig, packLanguage, resolveDiscovery, } from '@kindgi/handler-runtime';
|
|
39
39
|
import { LOCAL_ENV_NAME, displayEnvPath, packValues, readPackEnv, runtimeValues, } from '@kindgi/secrets-dotenv';
|
|
40
|
-
import { CORS_ORIGINS_VAR, PUBLIC_TOKEN_KEY_PATH_VAR, parseCorsOrigins } from '@kindgi/env-schema';
|
|
40
|
+
import { CORS_ORIGINS_VAR, EXPORT_SIGNING_KEY_PATH_VAR, PUBLIC_TOKEN_KEY_PATH_VAR, parseCorsOrigins, } from '@kindgi/env-schema';
|
|
41
41
|
import { createDevOnlyImportsCheck } from '../dev/dev-only-imports.js';
|
|
42
|
-
import {
|
|
42
|
+
import { DEV_GOOGLE_CREDENTIALS_VAR, VERTEX_PROVIDER_ID, isVertexRegistration, resolveDevGoogleCredentials, vertexCredentialsHint, } from '../dev/google-credentials.js';
|
|
43
|
+
import { DEFAULT_DEV_LOG_VIEW, parseDevLogFlags, resolveDevLogView, runtimeLogLevels, showIndexerLine, showLine, showText, sourceLogEnv, } from '../dev/log-view.js';
|
|
44
|
+
import { isJvmPackCode, resolvePackCode } from '../dev/pack-code.js';
|
|
43
45
|
import { devPackEnv, devPackEnvFiles } from '../dev/pack-env.js';
|
|
44
|
-
import { createPackRefresher,
|
|
46
|
+
import { createPackRefresher, showPackEvent } from '../dev/pack-service.js';
|
|
45
47
|
import { PORT_SEARCH_SPAN, firstFreePort } from '../dev/port.js';
|
|
46
48
|
import { resolveDevProject } from '../dev/project.js';
|
|
47
49
|
import { adoptLegacyBundledEntries, declaredProviders, describeReconcile, devProvidersKey, devProvidersRecordPath, readOwnedProviders, reconcileProviders, writeOwnedProviders, } from '../dev/providers.js';
|
|
@@ -50,17 +52,19 @@ import { RuntimeStartStopped } from '../dev/runtime-container.js';
|
|
|
50
52
|
import { DEFAULT_RUNTIME_IMAGE } from '../dev/runtime-image.js';
|
|
51
53
|
import { describeEnvDiagnostics, loadLocalEnvSettings } from '../env/project-env.js';
|
|
52
54
|
import { PYPI_NO_BUNDLER } from '../esbuild-loader.js';
|
|
55
|
+
import { openUrlInBrowser } from '../open-url.js';
|
|
53
56
|
import { renderJson } from '../output.js';
|
|
54
57
|
import { binDisplay, cliInstall, detectBinRunner } from '../package-manager.js';
|
|
55
58
|
import { loadProviderPresets } from '../providers/preset-loader.js';
|
|
56
59
|
import { CLI_VERSION } from '../version-info.js';
|
|
60
|
+
import { consoleUrlOf, couldNotOpen } from './console.js';
|
|
57
61
|
import { defaultSdkSkillsRoot } from './init.js';
|
|
58
62
|
import { detectSkillDrift } from './skills.js';
|
|
59
63
|
export const devCommand = {
|
|
60
64
|
kind: 'leaf',
|
|
61
65
|
name: 'dev',
|
|
62
66
|
description: 'Run the Kindgi runtime as a container + hot-reload the pack under cwd.',
|
|
63
|
-
usage: 'kindgi dev [--port <n>] [--database-url <url>] [--tenant <id>] [--dev-token <token>] [--no-watch] [--path <dir>] [--reset [--yes]] [--recreate-services] [--runtime-image <ref> | --runtime-url <url>]',
|
|
67
|
+
usage: 'kindgi dev [--port <n>] [--database-url <url>] [--tenant <id>] [--dev-token <token>] [--no-watch] [--open] [--path <dir>] [--reset [--yes]] [--recreate-services] [--runtime-image <ref> | --runtime-url <url>] [--log-level <level>] [--log <subsystem>=<level>]... [--log-format pretty|json] [--quiet]',
|
|
64
68
|
optionSpec: {
|
|
65
69
|
port: {
|
|
66
70
|
type: 'string',
|
|
@@ -100,9 +104,13 @@ export const devCommand = {
|
|
|
100
104
|
type: 'boolean',
|
|
101
105
|
description: 'Start, index and register once, then exit. For smoke tests and CI.',
|
|
102
106
|
},
|
|
107
|
+
open: {
|
|
108
|
+
type: 'boolean',
|
|
109
|
+
description: 'Open the console in your browser once Kindgi is up.',
|
|
110
|
+
},
|
|
103
111
|
path: {
|
|
104
112
|
type: 'string',
|
|
105
|
-
description: 'The pack root, with a `kindgi.config.ts` (or `.mts`)
|
|
113
|
+
description: 'The pack root, with a `kindgi.config.ts` (or `.mts`), a `pyproject.toml` with `[tool.kindgi]`, or a `kindgi.config.json` (Java). Default: the current directory.',
|
|
106
114
|
},
|
|
107
115
|
// --reset: a fresh start for the project. With the bundled Postgres it
|
|
108
116
|
// drops the project's database (asking first) and makes a new token;
|
|
@@ -123,6 +131,21 @@ export const devCommand = {
|
|
|
123
131
|
type: 'boolean',
|
|
124
132
|
description: 'Let `docker compose` recreate the bundled Postgres if its definition changed (needs compose). By default an existing container is reused.',
|
|
125
133
|
},
|
|
134
|
+
// The runtime's and the pack service's records: what's shown, and how.
|
|
135
|
+
// `--quiet` (a global flag) keeps errors only.
|
|
136
|
+
'log-level': {
|
|
137
|
+
type: 'string',
|
|
138
|
+
description: "The lowest level of the log records shown: error, warn, info, debug or trace. Default: `KINDGI_LOG_LEVEL` (the shell's, then the env files'), else info; with `--quiet`, error.",
|
|
139
|
+
},
|
|
140
|
+
log: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
multiple: true,
|
|
143
|
+
description: "A subsystem's own level, `<subsystem>=<level>` (e.g. `--log=http=debug`, `--log=pack=debug`); repeat it, or give a comma list. A dotted child inherits its parent's (`pack` covers `pack.tool`).",
|
|
144
|
+
},
|
|
145
|
+
'log-format': {
|
|
146
|
+
type: 'string',
|
|
147
|
+
description: 'How log records are shown: `pretty` (the default: tagged `[runtime]` / `[pack]`, coloured on a terminal unless `NO_COLOR` is set) or `json` (each record as written, one per line on stdout, for `| jq`; everything else stays on stderr).',
|
|
148
|
+
},
|
|
126
149
|
},
|
|
127
150
|
run: async (ctx) => runDev(ctx),
|
|
128
151
|
};
|
|
@@ -146,9 +169,31 @@ export const DEFAULT_WATCH_DEBOUNCE_MS = 200;
|
|
|
146
169
|
* so nothing to intercept.
|
|
147
170
|
*/
|
|
148
171
|
function emitProgress(msg) {
|
|
172
|
+
if (logView.quiet)
|
|
173
|
+
return;
|
|
174
|
+
emitProblem(msg);
|
|
175
|
+
}
|
|
176
|
+
/** A progress line that's an error: shown under `--quiet` too. */
|
|
177
|
+
function emitProblem(msg) {
|
|
149
178
|
process.stderr.write(`${stoppingLineOpen ? '\n' : ''} ${msg}\n`);
|
|
150
179
|
stoppingLineOpen = false;
|
|
151
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* How logs show this session (`dev/log-view.ts`): set from the flags as
|
|
183
|
+
* `runDev` starts, and again once the env files are read.
|
|
184
|
+
*/
|
|
185
|
+
let logView = DEFAULT_DEV_LOG_VIEW;
|
|
186
|
+
/** A source's line as the view shows it: records on stdout with `--log-format=json`. */
|
|
187
|
+
function emitOutput(output) {
|
|
188
|
+
if (output === undefined)
|
|
189
|
+
return;
|
|
190
|
+
for (const line of output.lines) {
|
|
191
|
+
if (output.stream === 'stdout')
|
|
192
|
+
process.stdout.write(`${line}\n`);
|
|
193
|
+
else
|
|
194
|
+
emitProblem(` ${line}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
152
197
|
/**
|
|
153
198
|
* Shutdown is one line: "Stopping kindgi dev..." the moment the signal
|
|
154
199
|
* arrives, finished with "stopped." once the runtime and the pack service
|
|
@@ -177,7 +222,7 @@ async function withHeartbeat(label, intervalMs, work) {
|
|
|
177
222
|
const started = Date.now();
|
|
178
223
|
const tick = setInterval(() => {
|
|
179
224
|
const elapsed = Math.round((Date.now() - started) / 1000);
|
|
180
|
-
|
|
225
|
+
emitProgress(`⋯ ${label} (${elapsed}s elapsed)`);
|
|
181
226
|
}, intervalMs);
|
|
182
227
|
try {
|
|
183
228
|
return await work();
|
|
@@ -194,6 +239,14 @@ export async function runDev(ctx) {
|
|
|
194
239
|
if (parsed.kind === 'error')
|
|
195
240
|
return parsed;
|
|
196
241
|
const args = parsed.args;
|
|
242
|
+
// How logs show: the flags and the shell's settings now, the env files'
|
|
243
|
+
// once they're read.
|
|
244
|
+
const stderrIsTTY = process.stderr.isTTY === true;
|
|
245
|
+
const earlyView = resolveDevLogView(args.log, { env: ctx.env, files: {}, isTTY: stderrIsTTY });
|
|
246
|
+
if (earlyView.kind === 'error') {
|
|
247
|
+
return { kind: 'error', stderr: `kindgi dev: ${earlyView.message}\n`, exitCode: 1 };
|
|
248
|
+
}
|
|
249
|
+
logView = earlyView.value;
|
|
197
250
|
const runners = pickRunners(ctx);
|
|
198
251
|
if (runners.kind === 'error')
|
|
199
252
|
return runners;
|
|
@@ -205,7 +258,7 @@ export async function runDev(ctx) {
|
|
|
205
258
|
if (configFile === undefined) {
|
|
206
259
|
return {
|
|
207
260
|
kind: 'error',
|
|
208
|
-
stderr: `kindgi dev could not find a kindgi.config.ts (or a pyproject.toml with a [tool.kindgi] table) at ${args.packDir}.\nRun \`kindgi init <pack-name>\` to scaffold a pack, or pass --path=<dir> to point at an existing one.\n`,
|
|
261
|
+
stderr: `kindgi dev could not find a kindgi.config.ts (or a pyproject.toml with a [tool.kindgi] table, or a kindgi.config.json) at ${args.packDir}.\nRun \`kindgi init <pack-name>\` to scaffold a pack, or pass --path=<dir> to point at an existing one.\n`,
|
|
209
262
|
exitCode: 1,
|
|
210
263
|
};
|
|
211
264
|
}
|
|
@@ -215,6 +268,15 @@ export async function runDev(ctx) {
|
|
|
215
268
|
const projectEnv = await loadDevProjectEnv(ctx, args.packDir);
|
|
216
269
|
if (projectEnv.kind === 'error')
|
|
217
270
|
return projectEnv;
|
|
271
|
+
const view = resolveDevLogView(args.log, {
|
|
272
|
+
env: ctx.env,
|
|
273
|
+
files: projectEnv.runtime,
|
|
274
|
+
isTTY: stderrIsTTY,
|
|
275
|
+
});
|
|
276
|
+
if (view.kind === 'error') {
|
|
277
|
+
return { kind: 'error', stderr: `kindgi dev: ${view.message}\n`, exitCode: 1 };
|
|
278
|
+
}
|
|
279
|
+
logView = view.value;
|
|
218
280
|
// The PyPI CLI (kindgi-cli) has no TypeScript bundler: say so before anything starts.
|
|
219
281
|
if (projectEnv.language === 'node' && cliInstall(ctx.env) === 'pypi') {
|
|
220
282
|
return { kind: 'error', stderr: `kindgi dev: ${PYPI_NO_BUNDLER}\n`, exitCode: 1 };
|
|
@@ -231,6 +293,22 @@ export async function runDev(ctx) {
|
|
|
231
293
|
if (declared.kind === 'invalid') {
|
|
232
294
|
return { kind: 'error', stderr: `kindgi dev: ${declared.message}\n`, exitCode: 1 };
|
|
233
295
|
}
|
|
296
|
+
// Google credentials for Vertex AI: only the ones KINDGI_DEV_GOOGLE_CREDENTIALS
|
|
297
|
+
// names (the shell, then the env files) reach the runtime. A declared
|
|
298
|
+
// Vertex provider without them is said now, before anything starts.
|
|
299
|
+
const google = resolveDevGoogleCredentials(ctx.env[DEV_GOOGLE_CREDENTIALS_VAR] ?? projectEnv.runtime[DEV_GOOGLE_CREDENTIALS_VAR], ctx.env);
|
|
300
|
+
if (google.kind === 'error') {
|
|
301
|
+
return { kind: 'error', stderr: `kindgi dev: ${google.message}\n`, exitCode: 1 };
|
|
302
|
+
}
|
|
303
|
+
const declaredVertex = declared.providers
|
|
304
|
+
.filter((p) => isVertexRegistration(p.input))
|
|
305
|
+
.map((p) => p.id);
|
|
306
|
+
if (google.credentials !== undefined) {
|
|
307
|
+
emitProgress(`✓ Google credentials: ${google.credentials.path} (${google.credentials.who}), mounted read-only for Vertex AI`);
|
|
308
|
+
}
|
|
309
|
+
else if (declaredVertex.length > 0) {
|
|
310
|
+
emitProgress(`⚠ ${vertexCredentialsHint(declaredVertex, ctx.env)}`);
|
|
311
|
+
}
|
|
234
312
|
// The runtime's port, before anything starts. Taken without `--port`
|
|
235
313
|
// (another `kindgi dev`, say): the next free one, which `.kindgirc.json`
|
|
236
314
|
// then records for every client. Taken with `--port`: refused.
|
|
@@ -375,12 +453,16 @@ export async function runDev(ctx) {
|
|
|
375
453
|
// The pack's code is bundled and runs in a local pack service. It
|
|
376
454
|
// starts once the pack is bundled and indexed; the api-server gets
|
|
377
455
|
// its transport now.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
...(
|
|
381
|
-
|
|
456
|
+
// The pack service and the indexer write records at the levels shown.
|
|
457
|
+
const packEnv = async () => ({
|
|
458
|
+
...(await devPackEnv({
|
|
459
|
+
packDir: args.packDir,
|
|
460
|
+
...(projectEnv.localEnvFiles !== undefined && { localEnvFiles: projectEnv.localEnvFiles }),
|
|
461
|
+
hostEnv: ctx.env,
|
|
462
|
+
})),
|
|
463
|
+
...sourceLogEnv(logView),
|
|
382
464
|
});
|
|
383
|
-
const code = await resolveDevPackCode(dev, projectEnv.language, args.packDir, projectEnv.config, packEnv);
|
|
465
|
+
const code = await resolveDevPackCode(dev, projectEnv.language, args.packDir, projectEnv.config, packEnv, ctx.env);
|
|
384
466
|
if (code.kind === 'error') {
|
|
385
467
|
return code;
|
|
386
468
|
}
|
|
@@ -392,11 +474,10 @@ export async function runDev(ctx) {
|
|
|
392
474
|
packDir: args.packDir,
|
|
393
475
|
code: code.value,
|
|
394
476
|
env: packEnv,
|
|
395
|
-
onLog: (line) =>
|
|
477
|
+
onLog: (line, stream) => emitOutput(showText('pack', line, logView, stream)),
|
|
396
478
|
onEvent: (event) => {
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
emitProgress(line);
|
|
479
|
+
for (const output of showPackEvent(event, logView))
|
|
480
|
+
emitOutput(output);
|
|
400
481
|
},
|
|
401
482
|
};
|
|
402
483
|
// The front listens for the whole session; children come and go behind
|
|
@@ -434,6 +515,7 @@ export async function runDev(ctx) {
|
|
|
434
515
|
packDir: args.packDir,
|
|
435
516
|
env: packEnv,
|
|
436
517
|
code: code.value,
|
|
518
|
+
onIndexerOutput: (line) => emitOutput(showIndexerLine(line, logView)),
|
|
437
519
|
...(devOnly !== undefined && {
|
|
438
520
|
onBuild: async (build) => {
|
|
439
521
|
if (build.externals === undefined)
|
|
@@ -467,12 +549,19 @@ export async function runDev(ctx) {
|
|
|
467
549
|
...(publicRunTokens.keyPath !== undefined && {
|
|
468
550
|
publicRunTokenKeyPath: publicRunTokens.keyPath,
|
|
469
551
|
}),
|
|
552
|
+
...(publicRunTokens.exportKeyPath !== undefined && {
|
|
553
|
+
exportSigningKeyPath: publicRunTokens.exportKeyPath,
|
|
554
|
+
}),
|
|
470
555
|
...(publicRunTokens.corsOrigins.length > 0 && {
|
|
471
556
|
corsOrigins: publicRunTokens.corsOrigins,
|
|
472
557
|
}),
|
|
558
|
+
...(google.credentials !== undefined && {
|
|
559
|
+
googleCredentialsPath: google.credentials.path,
|
|
560
|
+
}),
|
|
473
561
|
runtimeImage: args.runtimeImage,
|
|
474
562
|
...(args.runtimeUrl !== undefined && { runtimeUrl: args.runtimeUrl }),
|
|
475
|
-
|
|
563
|
+
logLevels: runtimeLogLevels(logView),
|
|
564
|
+
onLog: (line, stream) => emitOutput(showLine('runtime', line, logView, stream)),
|
|
476
565
|
onProgress: emitProgress,
|
|
477
566
|
...(ctx.stopSignal !== undefined && { signal: ctx.stopSignal }),
|
|
478
567
|
}));
|
|
@@ -537,8 +626,18 @@ export async function runDev(ctx) {
|
|
|
537
626
|
});
|
|
538
627
|
const providers = await registeredProviders(client);
|
|
539
628
|
const registerProviderCommand = await registerProviderHint(kindgi);
|
|
629
|
+
// A Vertex provider registered by hand (the `gemini` preset) has no
|
|
630
|
+
// credentials either; a declared one was named before the start.
|
|
631
|
+
if (google.credentials === undefined) {
|
|
632
|
+
const byHand = (providers ?? [])
|
|
633
|
+
.map((p) => p.id)
|
|
634
|
+
.filter((id) => id === VERTEX_PROVIDER_ID && !declaredVertex.includes(id));
|
|
635
|
+
if (byHand.length > 0)
|
|
636
|
+
emitProgress(`⚠ ${vertexCredentialsHint(byHand, ctx.env)}`);
|
|
637
|
+
}
|
|
540
638
|
const bannerLines = renderDevBanner({
|
|
541
639
|
baseUrl: server.baseUrl,
|
|
640
|
+
consoleMounted: server.consoleMounted === true,
|
|
542
641
|
tenantId: server.tenantId,
|
|
543
642
|
token: server.token,
|
|
544
643
|
providers,
|
|
@@ -549,6 +648,7 @@ export async function runDev(ctx) {
|
|
|
549
648
|
discoveryRoots: discoveryRoots(projectEnv.discoveryPatterns),
|
|
550
649
|
...(servicesHandle !== undefined && { autoStartedServices: servicesHandle.services }),
|
|
551
650
|
corsOrigins: publicRunTokens.corsOrigins,
|
|
651
|
+
...(google.credentials !== undefined && { googleCredentials: google.credentials }),
|
|
552
652
|
});
|
|
553
653
|
// Write `.kindgirc.json` to the pack root so a SECOND terminal in
|
|
554
654
|
// the same directory (`cd <pack>; kindgi runs start ...`) picks up
|
|
@@ -594,13 +694,14 @@ export async function runDev(ctx) {
|
|
|
594
694
|
emitProgress('════════════════════════════════════════');
|
|
595
695
|
emitProgress(' ✓ Kindgi is up');
|
|
596
696
|
emitProgress('════════════════════════════════════════');
|
|
697
|
+
if (server.consoleMounted === true) {
|
|
698
|
+
for (const line of renderConsoleLines(server.baseUrl))
|
|
699
|
+
emitProgress(line);
|
|
700
|
+
}
|
|
597
701
|
emitProgress(` API ${server.baseUrl}`);
|
|
598
702
|
if (project !== undefined) {
|
|
599
703
|
emitProgress(` Project ${project.name} · database ${project.database}`);
|
|
600
704
|
}
|
|
601
|
-
if (server.consoleMounted === true) {
|
|
602
|
-
emitProgress(` Console ${server.baseUrl}/console/`);
|
|
603
|
-
}
|
|
604
705
|
emitProgress(` Tenant ${server.tenantId}`);
|
|
605
706
|
emitProgress(` Token ${server.token}`);
|
|
606
707
|
if (providers !== undefined) {
|
|
@@ -637,6 +738,16 @@ export async function runDev(ctx) {
|
|
|
637
738
|
emitProgress(' Ctrl+C to stop.');
|
|
638
739
|
emitProgress('');
|
|
639
740
|
}
|
|
741
|
+
if (args.open) {
|
|
742
|
+
if (server.consoleMounted === true) {
|
|
743
|
+
const opened = await (ctx.openUrl ?? openUrlInBrowser)(consoleUrlOf(server.baseUrl));
|
|
744
|
+
emitProgress(opened.ok ? ' Opened the console in your browser.' : ` ${couldNotOpen(opened.reason)}`);
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
emitProgress(' --open: this runtime serves no console, so there is nothing to open.');
|
|
748
|
+
}
|
|
749
|
+
emitProgress('');
|
|
750
|
+
}
|
|
640
751
|
const watchHandles = [];
|
|
641
752
|
let watchTicks = 0;
|
|
642
753
|
let lastWatchOutcome;
|
|
@@ -684,7 +795,7 @@ export async function runDev(ctx) {
|
|
|
684
795
|
}
|
|
685
796
|
else {
|
|
686
797
|
lastWatchReport = undefined;
|
|
687
|
-
|
|
798
|
+
emitProblem(` ✗ refresh failed [${outcome.code}] ${outcome.message}`);
|
|
688
799
|
}
|
|
689
800
|
})();
|
|
690
801
|
inFlightTicks.add(tick);
|
|
@@ -738,6 +849,7 @@ export async function runDev(ctx) {
|
|
|
738
849
|
// stood when kindgi dev stopped.
|
|
739
850
|
const summary = {
|
|
740
851
|
apiUrl: server.baseUrl,
|
|
852
|
+
...(server.consoleMounted === true && { consoleUrl: consoleUrlOf(server.baseUrl) }),
|
|
741
853
|
tenantId: server.tenantId,
|
|
742
854
|
token: server.token,
|
|
743
855
|
port: server.port,
|
|
@@ -756,14 +868,19 @@ export async function runDev(ctx) {
|
|
|
756
868
|
const stdout = ctx.globals.formatRequested ? renderJson(summary, ctx.globals.format).stdout : '';
|
|
757
869
|
return {
|
|
758
870
|
kind: 'ok',
|
|
759
|
-
|
|
871
|
+
// --quiet: errors only, so no summary.
|
|
872
|
+
rendered: {
|
|
873
|
+
stdout,
|
|
874
|
+
stderr: args.watch || logView.quiet ? '' : `${bannerLines.join('\n')}\n`,
|
|
875
|
+
},
|
|
760
876
|
};
|
|
761
877
|
}
|
|
762
878
|
/**
|
|
763
879
|
* Public run tokens for the browser app under development: signed with
|
|
764
880
|
* the key file when `KINDGI_PUBLIC_TOKEN_SIGNING_KEY_PATH` is set,
|
|
765
881
|
* otherwise with a key made now (tokens stop working when `kindgi dev`
|
|
766
|
-
* stops).
|
|
882
|
+
* stops). Exports the same way: `KINDGI_EXPORT_SIGNING_KEY_PATH`'s key
|
|
883
|
+
* file, otherwise a key the runtime makes at startup. `KINDGI_CORS_ORIGINS` lists the app's origins
|
|
767
884
|
* (`http://localhost:3000`). Both come from the shell, then the env files,
|
|
768
885
|
* like `KINDGI_DATABASE_URL`.
|
|
769
886
|
*/
|
|
@@ -773,11 +890,19 @@ async function resolveDevPublicRunTokens(shell, files) {
|
|
|
773
890
|
return value === undefined || value.trim() === '' ? undefined : value.trim();
|
|
774
891
|
};
|
|
775
892
|
try {
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
893
|
+
const keyFile = (name) => {
|
|
894
|
+
const path = pick(name);
|
|
895
|
+
if (path !== undefined && (!isAbsolute(path) || !existsSync(path))) {
|
|
896
|
+
throw new Error(`${name} must be the absolute path of an existing key file. Got "${path}".`);
|
|
897
|
+
}
|
|
898
|
+
return path;
|
|
899
|
+
};
|
|
900
|
+
return {
|
|
901
|
+
kind: 'ok',
|
|
902
|
+
keyPath: keyFile(PUBLIC_TOKEN_KEY_PATH_VAR),
|
|
903
|
+
exportKeyPath: keyFile(EXPORT_SIGNING_KEY_PATH_VAR),
|
|
904
|
+
corsOrigins: parseCorsOrigins(pick(CORS_ORIGINS_VAR)),
|
|
905
|
+
};
|
|
781
906
|
}
|
|
782
907
|
catch (err) {
|
|
783
908
|
return { kind: 'error', stderr: `kindgi dev: ${err.message}\n`, exitCode: 1 };
|
|
@@ -902,6 +1027,16 @@ function resolveDevArgs(ctx) {
|
|
|
902
1027
|
};
|
|
903
1028
|
}
|
|
904
1029
|
const watch = !watchOff;
|
|
1030
|
+
// --open — the console in the browser; with --no-watch the runtime
|
|
1031
|
+
// stops as kindgi dev exits, so there'd be nothing to open.
|
|
1032
|
+
const open = ctx.options.open === true;
|
|
1033
|
+
if (open && !watch) {
|
|
1034
|
+
return {
|
|
1035
|
+
kind: 'error',
|
|
1036
|
+
stderr: "Contradictory flags: --open and --no-watch. With --no-watch the runtime stops when kindgi dev exits, so there's no console to open.\n",
|
|
1037
|
+
exitCode: 1,
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
905
1040
|
// --path — pack root. Default is cwd.
|
|
906
1041
|
const pathFlag = ctx.options.path;
|
|
907
1042
|
const rawPath = typeof pathFlag === 'string' && pathFlag !== '' ? pathFlag : ctx.cwd;
|
|
@@ -929,6 +1064,16 @@ function resolveDevArgs(ctx) {
|
|
|
929
1064
|
};
|
|
930
1065
|
}
|
|
931
1066
|
const runtimeImage = typeof imageFlag === 'string' && imageFlag !== '' ? imageFlag : DEFAULT_RUNTIME_IMAGE;
|
|
1067
|
+
// --log-level / --log / --log-format / --quiet — what the logs show, and how.
|
|
1068
|
+
const log = parseDevLogFlags({
|
|
1069
|
+
level: ctx.options['log-level'],
|
|
1070
|
+
log: ctx.options.log,
|
|
1071
|
+
format: ctx.options['log-format'],
|
|
1072
|
+
quiet: ctx.globals.format === 'quiet',
|
|
1073
|
+
});
|
|
1074
|
+
if (log.kind === 'error') {
|
|
1075
|
+
return { kind: 'error', stderr: `kindgi dev: ${log.message}\n`, exitCode: 1 };
|
|
1076
|
+
}
|
|
932
1077
|
return {
|
|
933
1078
|
kind: 'ok',
|
|
934
1079
|
args: {
|
|
@@ -938,12 +1083,14 @@ function resolveDevArgs(ctx) {
|
|
|
938
1083
|
tenantId,
|
|
939
1084
|
token,
|
|
940
1085
|
watch,
|
|
1086
|
+
open,
|
|
941
1087
|
packDir,
|
|
942
1088
|
reset,
|
|
943
1089
|
yes,
|
|
944
1090
|
recreateServices,
|
|
945
1091
|
runtimeImage,
|
|
946
1092
|
runtimeUrl,
|
|
1093
|
+
log: log.value,
|
|
947
1094
|
},
|
|
948
1095
|
};
|
|
949
1096
|
}
|
|
@@ -1049,19 +1196,20 @@ async function readPersistedRc(kindgircPath) {
|
|
|
1049
1196
|
/** What the boot loaded, live: the counts and failures, no primitives yet, or the indexer's error. */
|
|
1050
1197
|
function emitBootIndex(bootIndex, bootReport, roots) {
|
|
1051
1198
|
if (bootIndex.kind !== 'ok') {
|
|
1052
|
-
// Dev stays up either way; the section says so.
|
|
1199
|
+
// Dev stays up either way; the section says so. No primitives yet isn't an error.
|
|
1200
|
+
const emit = bootIndex.code === 'discovery-empty' ? emitProgress : emitProblem;
|
|
1053
1201
|
for (const line of renderIndexSection({ bootIndex, bootReport, discoveryRoots: roots })) {
|
|
1054
|
-
|
|
1202
|
+
emit(line.replace(/^ {2}/, ''));
|
|
1055
1203
|
}
|
|
1056
1204
|
return;
|
|
1057
1205
|
}
|
|
1058
1206
|
const c = bootIndex.counts;
|
|
1059
1207
|
emitProgress(`✓ loaded: ${c.tools} tools, ${c.guardrails} guardrails, ${c.agents} agents, ${c.flows} flows`);
|
|
1060
1208
|
for (const e of bootIndex.fileErrors) {
|
|
1061
|
-
|
|
1209
|
+
emitProblem(` ⚠ indexer: ${e.filePath ?? '?'} [${e.code}] ${e.message}`);
|
|
1062
1210
|
}
|
|
1063
1211
|
for (const f of bootReport.failed) {
|
|
1064
|
-
|
|
1212
|
+
emitProblem(` ⚠ ${f.kind}: ${f.id} — ${f.message ?? 'unknown reason'}`);
|
|
1065
1213
|
}
|
|
1066
1214
|
}
|
|
1067
1215
|
/**
|
|
@@ -1161,12 +1309,12 @@ function emitWatchTick(input) {
|
|
|
1161
1309
|
emitProgress(` ✓ loaded ${registered} primitives (${totals}) in ${elapsedMs}ms`);
|
|
1162
1310
|
return;
|
|
1163
1311
|
}
|
|
1164
|
-
|
|
1312
|
+
emitProblem(` ⚠ loaded ${registered} of ${registered + failed.length} in ${elapsedMs}ms — ${totals}`);
|
|
1165
1313
|
for (const e of fileErrors) {
|
|
1166
|
-
|
|
1314
|
+
emitProblem(` ✗ indexer: ${e.filePath ?? '?'} [${e.code}] ${e.message}`);
|
|
1167
1315
|
}
|
|
1168
1316
|
for (const f of failed) {
|
|
1169
|
-
|
|
1317
|
+
emitProblem(` ✗ ${f.kind}: ${f.id} — ${f.message ?? 'unknown reason'}`);
|
|
1170
1318
|
}
|
|
1171
1319
|
}
|
|
1172
1320
|
/**
|
|
@@ -1200,11 +1348,11 @@ async function emitSkillDriftHint(packDir, language, syncCommand) {
|
|
|
1200
1348
|
}
|
|
1201
1349
|
/**
|
|
1202
1350
|
* How this pack's code runs (`dev/pack-code.ts`). For a Python pack, the
|
|
1203
|
-
* interpreter
|
|
1204
|
-
* before anything boots.
|
|
1351
|
+
* interpreter, and for a JVM pack, the JDK and Maven or sbt, are resolved
|
|
1352
|
+
* and checked — with the pack's own environment — before anything boots.
|
|
1205
1353
|
*/
|
|
1206
|
-
async function resolveDevPackCode(dev, language, packDir, config, packEnv) {
|
|
1207
|
-
const resolved = await resolvePackCode(language, packDir, config);
|
|
1354
|
+
async function resolveDevPackCode(dev, language, packDir, config, packEnv, hostEnv) {
|
|
1355
|
+
const resolved = await resolvePackCode(language, packDir, config, hostEnv);
|
|
1208
1356
|
if (resolved.kind === 'err') {
|
|
1209
1357
|
return { kind: 'error', stderr: `kindgi dev: ${resolved.message}\n`, exitCode: 1 };
|
|
1210
1358
|
}
|
|
@@ -1215,6 +1363,13 @@ async function resolveDevPackCode(dev, language, packDir, config, packEnv) {
|
|
|
1215
1363
|
}
|
|
1216
1364
|
emitProgress(`✓ pack code: ${checked.value}`);
|
|
1217
1365
|
}
|
|
1366
|
+
if (isJvmPackCode(resolved.value)) {
|
|
1367
|
+
const checked = await dev.checkPackJvm(resolved.value, await packEnv(), packDir);
|
|
1368
|
+
if (checked.kind === 'err') {
|
|
1369
|
+
return { kind: 'error', stderr: `kindgi dev: ${checked.message}\n`, exitCode: 1 };
|
|
1370
|
+
}
|
|
1371
|
+
emitProgress(`✓ pack code: ${checked.value}`);
|
|
1372
|
+
}
|
|
1218
1373
|
return { kind: 'ok', value: resolved.value };
|
|
1219
1374
|
}
|
|
1220
1375
|
function getEnv(ctx, key) {
|
|
@@ -1322,11 +1477,25 @@ function describeProviders(providers, registerProviderCommand) {
|
|
|
1322
1477
|
return named;
|
|
1323
1478
|
return `${named} — canned replies; for a real model: ${registerProviderCommand}`;
|
|
1324
1479
|
}
|
|
1480
|
+
/**
|
|
1481
|
+
* The ready block's first lines: the console, and how to sign in to it
|
|
1482
|
+
* (T374). First, so the URL a person opens is the console's: the API's
|
|
1483
|
+
* own address used to be the first one printed, and answered 404.
|
|
1484
|
+
*/
|
|
1485
|
+
export function renderConsoleLines(baseUrl) {
|
|
1486
|
+
return [
|
|
1487
|
+
` Console ${consoleUrlOf(baseUrl)} (open in your browser)`,
|
|
1488
|
+
' Sign in: "Sign in as seeded user" on the sign-in page (the dev token, below)',
|
|
1489
|
+
];
|
|
1490
|
+
}
|
|
1325
1491
|
/** The banner `kindgi dev --no-watch` prints to stderr when it exits. */
|
|
1326
1492
|
export function renderDevBanner(inputs) {
|
|
1327
1493
|
const lines = [];
|
|
1328
1494
|
lines.push('');
|
|
1329
1495
|
lines.push(' Starting Kindgi locally (dev: the runtime in a container, your code on this machine)');
|
|
1496
|
+
if (inputs.consoleMounted === true) {
|
|
1497
|
+
lines.push(` Console ${consoleUrlOf(inputs.baseUrl)}`);
|
|
1498
|
+
}
|
|
1330
1499
|
lines.push(` API server ${inputs.baseUrl}`);
|
|
1331
1500
|
lines.push(` Tenant ${inputs.tenantId}`);
|
|
1332
1501
|
lines.push(` Bearer token ${inputs.token}`);
|
|
@@ -1340,6 +1509,9 @@ export function renderDevBanner(inputs) {
|
|
|
1340
1509
|
if (inputs.corsOrigins !== undefined) {
|
|
1341
1510
|
lines.push(` Browser origins ${describeBrowserOrigins(inputs.corsOrigins)}`);
|
|
1342
1511
|
}
|
|
1512
|
+
if (inputs.googleCredentials !== undefined) {
|
|
1513
|
+
lines.push(` Google credentials ${inputs.googleCredentials.path} (${inputs.googleCredentials.who}), read-only, for Vertex AI`);
|
|
1514
|
+
}
|
|
1343
1515
|
lines.push('');
|
|
1344
1516
|
lines.push(...renderIndexSection(inputs));
|
|
1345
1517
|
lines.push('');
|