neon 8.13.1 → 8.14.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 +2 -0
- package/dist/_chunks/{api-GbEaBZJ5.js → api-1MKsfpY3.js} +2 -3
- package/dist/_chunks/{api_keys-CNnnugbQ.js → api_keys-6Xnxl7a8.js} +2 -3
- package/dist/_chunks/{ask-DVwy0eUL.js → ask-Xlek1Pxh.js} +2 -3
- package/dist/_chunks/{auth-CIUtXByB.js → auth-DPSDYYtG.js} +6 -7
- package/dist/_chunks/{auth_selection-YX5_KZgD.js → auth_selection-CwGLN9Qz.js} +2 -3
- package/dist/_chunks/{bootstrap-wPZWa1sT.js → bootstrap-BDkvsAVJ.js} +2 -3
- package/dist/_chunks/{branches-BNa1xX1L.js → branches-Bp-5z1lM.js} +2 -3
- package/dist/_chunks/{bucket-BCdryTkD.js → bucket-D06bvDSa.js} +2 -3
- package/dist/_chunks/{checkout-CXIOydqZ.js → checkout-C6VMMgY6.js} +5 -6
- package/dist/_chunks/{claim-DqAvAvDm.js → claim-DlLZmcq0.js} +4 -5
- package/dist/_chunks/{cmd_pipeline-CEk93dGN.js → cmd_pipeline-BDE-TGto.js} +3 -6
- package/dist/_chunks/{config-BH_qRHiG.js → config-7SIE_C5O.js} +3 -4
- package/dist/_chunks/{connection_string-DB4awPzZ.js → connection_string-C9e7N4xk.js} +3 -4
- package/dist/_chunks/{credential_io-BS-0Pmwc.js → credential_io-DbeSh3Pl.js} +6 -9
- package/dist/_chunks/{credentials-BSjE9fRR.js → credentials-BMBNmW0t.js} +2 -3
- package/dist/_chunks/{data_api-Djxj5ZQD.js → data_api-CHDwvMTG.js} +2 -3
- package/dist/_chunks/{databases-Dok4wru7.js → databases-DC2h6IW2.js} +2 -3
- package/dist/_chunks/{deploy-D7B0Xfjg.js → deploy-DmKZcAnR.js} +3 -4
- package/dist/_chunks/{dev-CSvxAecE.js → dev-Dv0HKcFF.js} +7 -8
- package/dist/_chunks/{diff-DhxxbdQE.js → diff-dnxneH0u.js} +2 -3
- package/dist/_chunks/{docs-CrVybkTP.js → docs-CClmgj_Z.js} +2 -3
- package/dist/_chunks/{env-5HS5qQGd.js → env-BOt9AZ1j.js} +4 -5
- package/dist/_chunks/{env-BNm69Qh8.js → env-CIFMBEon.js} +3 -5
- package/dist/_chunks/{env-BpP3Dqpe.js → env-JgoSsmyt.js} +2 -3
- package/dist/_chunks/{feedback-CMayyTa8.js → feedback-mQmdTRFn.js} +2 -3
- package/dist/_chunks/{functions-Q0zuvtnk.js → functions-3ypiRwZK.js} +2 -3
- package/dist/_chunks/{git-H32TNt6M.js → git-Dxw9w9dK.js} +4 -5
- package/dist/_chunks/{init-BkA6RilG.js → init-BOOGv-mD.js} +2 -3
- package/dist/_chunks/{inspect-g0wekylj.js → inspect-yFAb61qo.js} +2 -3
- package/dist/_chunks/{ip_allow-5lLFvIuE.js → ip_allow-DBdxNEUa.js} +2 -3
- package/dist/_chunks/{link-BgtkOBws.js → link-CcwTXRny.js} +6 -7
- package/dist/_chunks/{logs-DWkpjzIH.js → logs-BB4uvblR.js} +2 -3
- package/dist/_chunks/{mcp-Bo-7TKc7.js → mcp-BznTRK3w.js} +2 -3
- package/dist/_chunks/{neon_auth-DpF83S24.js → neon_auth-Dw-ucM5Y.js} +102 -28
- package/dist/_chunks/{open-CX3BT3Tp.js → open-T2nI89Oh.js} +2 -3
- package/dist/_chunks/{operations-D4I-AxVs.js → operations-CzaR_uqx.js} +2 -3
- package/dist/_chunks/{orgs-xGfANwHQ.js → orgs-Dpbr-K0A.js} +2 -3
- package/dist/_chunks/{paths-DMq0Lt7a.js → paths-B55ZfOg1.js} +1 -2
- package/dist/_chunks/{plugins-DqD7BDO1.js → plugins-CKOcBuuP.js} +3 -4
- package/dist/_chunks/{profile-yXOiKk9R.js → profile-H0d7gFrX.js} +9 -10
- package/dist/_chunks/{profiles-DIB1av2Q.js → profiles-DTazQtjK.js} +4 -6
- package/dist/_chunks/{projects-BwI2Uo0z.js → projects-a3X4OFEJ.js} +2 -3
- package/dist/_chunks/{psql-BM-doe8e.js → psql-Bce4X0NG.js} +3 -4
- package/dist/_chunks/{psql-BNljLda2.js → psql-DwGeP0IV.js} +2 -4
- package/dist/_chunks/{realtime-BRqIyGR-.js → realtime-BwtzYf5a.js} +2 -3
- package/dist/_chunks/{roles-C3M4q9DS.js → roles-Bd9r8_pX.js} +1 -2
- package/dist/_chunks/{roles-B4w3YT_7.js → roles-xRuu0462.js} +2 -3
- package/dist/_chunks/{rolldown-runtime-8H4AJuhK.js → rolldown-runtime-BJohB4LM.js} +1 -2
- package/dist/_chunks/{secure_file-BucZj4yQ.js → secure_file-Caskdohg.js} +1 -2
- package/dist/_chunks/{set_context-DbrwoImy.js → set_context-ompB6d2D.js} +2 -3
- package/dist/_chunks/{skills-BP6pIm7O.js → skills-DKgafm65.js} +2 -3
- package/dist/_chunks/{snapshots-RJBzW8GM.js → snapshots-DxNhjcco.js} +3 -4
- package/dist/_chunks/{status-DV8Z2kw3.js → status-DS_yUXFo.js} +3 -4
- package/dist/_chunks/{triggers-BrRo1z4b.js → triggers-BfvyeJUC.js} +2 -3
- package/dist/_chunks/{user-dlOGXbX9.js → user-D9mC430O.js} +2 -3
- package/dist/_chunks/{vpc_endpoints-CNb0YfMo.js → vpc_endpoints-C-Y4WK2M.js} +3 -4
- package/dist/_shared/auth_selection.js +1 -2
- package/dist/_shared/credentials.js +1 -2
- package/dist/_shared/paths.js +1 -2
- package/dist/_shared/profiles.js +1 -2
- package/dist/_shared/secure_file.js +1 -2
- package/dist/analytics.js +4 -5
- package/dist/anonymous_id.js +2 -3
- package/dist/api.js +1 -2
- package/dist/auth.js +1 -2
- package/dist/auth_context.js +1 -2
- package/dist/auth_recovery.js +3 -4
- package/dist/claimable/api.js +1 -2
- package/dist/claimable/state.js +2 -3
- package/dist/cli.js +1 -2
- package/dist/commands/api.js +1 -1
- package/dist/commands/api_keys.js +1 -1
- package/dist/commands/ask.js +1 -1
- package/dist/commands/ask_sse.js +1 -2
- package/dist/commands/auth.js +1 -1
- package/dist/commands/bootstrap.js +1 -1
- package/dist/commands/branches.js +1 -1
- package/dist/commands/bucket.js +1 -1
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/claim.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/connection_string.js +1 -1
- package/dist/commands/credentials.js +1 -1
- package/dist/commands/data_api.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/deploy_help.js +1 -2
- package/dist/commands/dev.js +1 -1
- package/dist/commands/diff.js +1 -1
- package/dist/commands/docs.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env_output.js +2 -3
- package/dist/commands/feedback.js +1 -1
- package/dist/commands/functions.js +1 -1
- package/dist/commands/functions_new.js +2 -3
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +46 -47
- package/dist/commands/init.js +1 -1
- package/dist/commands/inspect.js +1 -1
- package/dist/commands/ip_allow.js +1 -1
- package/dist/commands/link.js +1 -1
- package/dist/commands/link_output.js +1 -2
- package/dist/commands/logs.js +1 -1
- package/dist/commands/manifest.js +1 -2
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/neon_auth.js +1 -1
- package/dist/commands/open.js +1 -1
- package/dist/commands/operations.js +1 -1
- package/dist/commands/orgs.js +1 -1
- package/dist/commands/plugins.js +1 -1
- package/dist/commands/profile.js +1 -1
- package/dist/commands/projects.js +1 -1
- package/dist/commands/psql.js +1 -1
- package/dist/commands/realtime.js +1 -1
- package/dist/commands/roles.js +1 -1
- package/dist/commands/schema_diff.js +1 -2
- package/dist/commands/set_context.js +1 -1
- package/dist/commands/skills.js +1 -1
- package/dist/commands/snapshots.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/subscribe.js +2 -3
- package/dist/commands/thinking_spinner.js +1 -2
- package/dist/commands/triggers.js +1 -1
- package/dist/commands/user.js +1 -1
- package/dist/commands/vpc_endpoints.js +1 -1
- package/dist/config.js +2 -3
- package/dist/config_edit.js +1 -2
- package/dist/config_format.js +1 -2
- package/dist/config_services.js +1 -2
- package/dist/config_source.js +1 -2
- package/dist/config_template.js +1 -2
- package/dist/context.js +1 -2
- package/dist/credential_io.js +1 -1
- package/dist/current_branch_fast_path.js +1 -2
- package/dist/custom_domains_api.js +1 -2
- package/dist/dev/env.js +1 -1
- package/dist/dev/functions.js +1 -2
- package/dist/dev/inputs.js +1 -2
- package/dist/dev/runtime.js +1 -2
- package/dist/dev/websocket.js +1 -2
- package/dist/env.js +1 -2
- package/dist/env_file.js +1 -2
- package/dist/env_services.js +2 -3
- package/dist/error_reporting.js +80 -160
- package/dist/errors.js +1 -2
- package/dist/functions/registry.js +1 -2
- package/dist/functions/scaffold.js +1 -2
- package/dist/functions/source.js +1 -2
- package/dist/functions_api.js +1 -2
- package/dist/help.js +1 -2
- package/dist/human_table.js +1 -2
- package/dist/index.js +3 -4
- package/dist/init/agents.js +1 -2
- package/dist/init/auth.js +5 -6
- package/dist/init/bootstrap.js +1 -2
- package/dist/init/build_config.js +1 -2
- package/dist/init/cancelled.js +1 -2
- package/dist/init/choices.js +2 -3
- package/dist/init/chrome.js +1 -2
- package/dist/init/copy.js +13 -3
- package/dist/init/detect.js +4 -5
- package/dist/init/detect_host.js +1 -2
- package/dist/init/funnel.js +63 -16
- package/dist/init/link.js +4 -5
- package/dist/init/mode.js +1 -2
- package/dist/init/plan.js +1 -2
- package/dist/init/run.js +152 -98
- package/dist/init/template_title.js +1 -2
- package/dist/init/tooling.js +6 -7
- package/dist/init/wizard.js +1 -2
- package/dist/keyring.js +1 -2
- package/dist/log.js +1 -2
- package/dist/mcp/agents.js +1 -2
- package/dist/mcp/install.js +1 -2
- package/dist/mcp/mint.js +2 -3
- package/dist/mcp/plan.js +1 -2
- package/dist/mcp/targets.js +1 -2
- package/dist/mcp/wizard.js +1 -2
- package/dist/neon_services.js +1 -2
- package/dist/node_version.js +1 -2
- package/dist/notices.js +1 -2
- package/dist/parameters.gen.js +1 -2
- package/dist/pkg.js +1 -2
- package/dist/plugins/plan.js +1 -2
- package/dist/plugins/run.js +1 -2
- package/dist/plugins/targets.js +1 -2
- package/dist/profile_keys.js +1 -2
- package/dist/project.js +1 -2
- package/dist/psql/cli.js +2 -3
- package/dist/psql/command/cmd_cond.js +1 -2
- package/dist/psql/command/cmd_connect.js +1 -2
- package/dist/psql/command/cmd_copy.js +2 -3
- package/dist/psql/command/cmd_describe.js +1 -2
- package/dist/psql/command/cmd_format.js +1 -2
- package/dist/psql/command/cmd_io.js +1 -1
- package/dist/psql/command/cmd_lo.js +1 -2
- package/dist/psql/command/cmd_meta.js +1 -2
- package/dist/psql/command/cmd_misc.js +1 -2
- package/dist/psql/command/cmd_pipeline.js +1 -1
- package/dist/psql/command/cmd_restrict.js +1 -2
- package/dist/psql/command/cmd_show.js +1 -2
- package/dist/psql/command/dispatch.js +2 -3
- package/dist/psql/command/inputQueue.js +1 -2
- package/dist/psql/command/shared.js +1 -2
- package/dist/psql/complete/filenames.js +1 -2
- package/dist/psql/complete/index.js +1 -2
- package/dist/psql/complete/matcher.js +1 -2
- package/dist/psql/complete/psqlVars.js +1 -2
- package/dist/psql/complete/queries.js +1 -2
- package/dist/psql/complete/rules.js +1 -2
- package/dist/psql/core/common.js +1 -1
- package/dist/psql/core/help.js +1 -2
- package/dist/psql/core/mainloop.js +2 -3
- package/dist/psql/core/prompt.js +1 -2
- package/dist/psql/core/settings.js +1 -2
- package/dist/psql/core/sqlHelp.js +1 -2
- package/dist/psql/core/startup.js +1 -1
- package/dist/psql/core/syncVars.js +1 -2
- package/dist/psql/core/variables.js +1 -2
- package/dist/psql/describe/formatters.js +1 -2
- package/dist/psql/describe/processNamePattern.js +1 -2
- package/dist/psql/describe/queries.js +1 -2
- package/dist/psql/describe/versionGate.js +1 -2
- package/dist/psql/index.js +1 -1
- package/dist/psql/io/history.js +1 -2
- package/dist/psql/io/input.js +1 -2
- package/dist/psql/io/lineEditor/buffer.js +1 -2
- package/dist/psql/io/lineEditor/complete.js +1 -2
- package/dist/psql/io/lineEditor/filename.js +1 -2
- package/dist/psql/io/lineEditor/index.js +1 -2
- package/dist/psql/io/lineEditor/keymap.js +1 -2
- package/dist/psql/io/lineEditor/vt100.js +1 -2
- package/dist/psql/io/pgpass.js +1 -2
- package/dist/psql/io/pgservice.js +1 -2
- package/dist/psql/io/psqlrc.js +2 -3
- package/dist/psql/print/aligned.js +1 -2
- package/dist/psql/print/asciidoc.js +1 -2
- package/dist/psql/print/crosstab.js +1 -2
- package/dist/psql/print/csv.js +1 -2
- package/dist/psql/print/html.js +1 -2
- package/dist/psql/print/json.js +1 -2
- package/dist/psql/print/latex.js +1 -2
- package/dist/psql/print/pager.js +1 -2
- package/dist/psql/print/troff.js +1 -2
- package/dist/psql/print/unaligned.js +1 -2
- package/dist/psql/print/units.js +1 -2
- package/dist/psql/scanner/slash.js +1 -2
- package/dist/psql/scanner/sql.js +1 -2
- package/dist/psql/scanner/stringutils.js +1 -2
- package/dist/psql/types/scanner.js +1 -2
- package/dist/psql/wire/connection.js +1 -2
- package/dist/psql/wire/copy.js +1 -2
- package/dist/psql/wire/notify.js +1 -2
- package/dist/psql/wire/pipeline.js +1 -2
- package/dist/psql/wire/protocol.js +1 -2
- package/dist/psql/wire/sasl.js +1 -2
- package/dist/psql/wire/tls.js +1 -2
- package/dist/refresh_lock.js +1 -2
- package/dist/retire_credential.js +2 -3
- package/dist/skills/catalog.js +1 -2
- package/dist/skills/check_worker.js +1 -2
- package/dist/skills/freshness.js +1 -2
- package/dist/skills/plan.js +1 -2
- package/dist/skills/run.js +1 -2
- package/dist/skills/targets.js +1 -2
- package/dist/skills/wizard.js +1 -2
- package/dist/sso_recovery.js +1 -2
- package/dist/storage_api.js +1 -2
- package/dist/test_utils/fixtures.js +1 -2
- package/dist/test_utils/neon_api_server.js +1 -2
- package/dist/test_utils/npm_env.js +1 -2
- package/dist/test_utils/oauth_server.js +1 -2
- package/dist/test_utils/project_dir.js +1 -2
- package/dist/test_utils/registry.js +1 -2
- package/dist/test_utils/rotating_oauth_server.js +1 -2
- package/dist/update_check_worker.js +1 -2
- package/dist/update_notifier.js +1 -2
- package/dist/utils/agent_flag.js +1 -2
- package/dist/utils/agent_picker.js +1 -2
- package/dist/utils/ai_gateway_notice.js +1 -2
- package/dist/utils/api_enums.js +3 -3
- package/dist/utils/auth.js +1 -2
- package/dist/utils/branch_name.js +1 -2
- package/dist/utils/branch_notice.js +1 -2
- package/dist/utils/branch_picker.js +1 -2
- package/dist/utils/cli_name.js +1 -2
- package/dist/utils/compute_units.js +1 -2
- package/dist/utils/config_diff.js +1 -2
- package/dist/utils/enrichers.js +1 -2
- package/dist/utils/esbuild.js +1 -2
- package/dist/utils/flags.js +1 -2
- package/dist/utils/formats.js +1 -2
- package/dist/utils/function_slug.js +1 -2
- package/dist/utils/git.js +1 -2
- package/dist/utils/git_diff.js +1 -2
- package/dist/utils/help_text.js +1 -2
- package/dist/utils/hooks.js +2 -3
- package/dist/utils/inspect_db.js +3 -4
- package/dist/utils/inspect_queries.js +1 -2
- package/dist/utils/json_file.js +1 -2
- package/dist/utils/middlewares.js +2 -3
- package/dist/utils/openapi.js +1 -2
- package/dist/utils/package_manager.js +1 -2
- package/dist/utils/point_in_time.js +1 -2
- package/dist/utils/psql.js +1 -2
- package/dist/utils/repeated_flags.js +1 -2
- package/dist/utils/service_picker.js +1 -2
- package/dist/utils/staging.js +1 -2
- package/dist/utils/string.js +1 -2
- package/dist/utils/ui.js +1 -2
- package/dist/utils/write_sync.js +1 -2
- package/dist/utils/zip.js +1 -2
- package/dist/vendor/postgres-meta/constants.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMeta.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaColumnPrivileges.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaColumns.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaConfig.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaExtensions.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaForeignTables.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaFunctions.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaIndexes.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaMaterializedViews.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaPolicies.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaPublications.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaRelationships.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaRoles.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaSchemas.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaTablePrivileges.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaTables.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaTriggers.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaTypes.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaVersion.js +1 -2
- package/dist/vendor/postgres-meta/lib/PostgresMetaViews.js +1 -2
- package/dist/vendor/postgres-meta/lib/constants.js +1 -2
- package/dist/vendor/postgres-meta/lib/db.js +1 -2
- package/dist/vendor/postgres-meta/lib/generators.js +1 -2
- package/dist/vendor/postgres-meta/lib/helpers.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/column_privileges.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/columns.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/config.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/extensions.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/foreign_tables.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/functions.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/indexes.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/materialized_views.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/policies.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/publications.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/roles.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/schemas.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/table.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/table_privileges.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/table_relationships.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/triggers.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/types.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/version.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/views.sql.js +1 -2
- package/dist/vendor/postgres-meta/lib/sql/views_key_dependencies.sql.js +1 -2
- package/dist/vendor/postgres-meta/templates/typescript.js +1 -2
- package/dist/writer.js +1 -2
- package/package.json +6 -6
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
const ERROR_MATCHERS = [
|
|
3
3
|
[/^Unknown command: (.*)$/, "UNKNOWN_COMMAND"],
|
|
4
4
|
[/^Missing required argument: (.*)$/, "MISSING_ARGUMENT"],
|
|
@@ -72,5 +72,4 @@ const isNetworkError = (err) => {
|
|
|
72
72
|
}
|
|
73
73
|
return false;
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
export { NETWORK_ERROR_MESSAGE, isNetworkError, isUnexpectedError, matchErrorCode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/functions/registry.ts
|
|
2
2
|
const MAX_PATH_LENGTH = 255;
|
|
3
3
|
const MAX_FILE_BYTES = 262144;
|
|
4
4
|
const MAX_TOTAL_BYTES = 2097152;
|
|
@@ -48,5 +48,4 @@ const parseTemplateItem = (text, validate, expectedId) => {
|
|
|
48
48
|
...operations ? { operations } : {}
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { MAX_FILE_BYTES, MAX_JSON_BYTES, MAX_TOTAL_BYTES, isContainedRelativePath, parseRegistryIndex, parseTemplateItem, recommendedOperations, resolveOperationById };
|
|
@@ -5,7 +5,7 @@ import { FUNCTION_SLUG_HELP, FUNCTION_SLUG_PATTERN, deriveFunctionSlug } from ".
|
|
|
5
5
|
import { resolveOperationById } from "./registry.js";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { dirname, join, relative, resolve } from "node:path";
|
|
8
|
-
|
|
8
|
+
// src/functions/scaffold.ts
|
|
9
9
|
const operationsFromFlags = (template, choice) => {
|
|
10
10
|
const operations = template.operations ?? [];
|
|
11
11
|
const explicit = choice.operations ?? [];
|
|
@@ -145,5 +145,4 @@ const planEnvExample = (projectRoot, environment) => {
|
|
|
145
145
|
added: missing.map(({ name }) => name)
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
//#endregion
|
|
149
148
|
export { collidingFiles, operationsFromFlags, planConfigRegistration, planEnvExample, planScaffold, writeScaffold };
|
package/dist/functions/source.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MAX_FILE_BYTES, MAX_JSON_BYTES, MAX_TOTAL_BYTES, isContainedRelativePath, parseRegistryIndex, parseTemplateItem } from "./registry.js";
|
|
2
2
|
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
3
3
|
import { posix, resolve, sep } from "node:path";
|
|
4
|
-
|
|
4
|
+
// src/functions/source.ts
|
|
5
5
|
const DEFAULT_REGISTRY_URL = "https://neon.com/functions/registry/registry.json";
|
|
6
6
|
const GITHUB_REGISTRY_URL = "https://raw.githubusercontent.com/neondatabase/examples/main/registry/registry.json";
|
|
7
7
|
const REGISTRY_DIR_ENV = "NEON_FUNCTION_REGISTRY_DIR";
|
|
@@ -177,5 +177,4 @@ const openRegistryAt = async (source, files = source) => {
|
|
|
177
177
|
load
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
-
//#endregion
|
|
181
180
|
export { DEFAULT_REGISTRY_URL, GITHUB_REGISTRY_URL, REGISTRY_DIR_ENV, REGISTRY_URL_ENV, RegistryError, describeRegistrySource, openRegistry, resolveRegistrySource, templateSourcePaths };
|
package/dist/functions_api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./api.js";
|
|
2
|
-
|
|
2
|
+
// src/functions_api.ts
|
|
3
3
|
const functionsPath = (projectId, branchId) => `/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}/functions`;
|
|
4
4
|
const listFunctions = async (apiClient, projectId, branchId, { cursor, limit } = {}) => {
|
|
5
5
|
const { data } = await apiClient.request({
|
|
@@ -46,5 +46,4 @@ const createDeployment = async (apiClient, projectId, branchId, slug, params) =>
|
|
|
46
46
|
secure: true
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { createDeployment, deleteFunction, getFunction, listFunctions };
|
package/dist/help.js
CHANGED
|
@@ -2,7 +2,7 @@ import { globalOptionsTrailer, helpWidth, wrapHelpText } from "./utils/help_text
|
|
|
2
2
|
import { consumeBlockIfMatches, consumeNextMatching, drawPointer, splitColumns } from "./utils/ui.js";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import cliui from "cliui";
|
|
5
|
-
|
|
5
|
+
// src/help.ts
|
|
6
6
|
const SPACE_WIDTH = 20;
|
|
7
7
|
const DESCRIPTION_GUTTER = 4;
|
|
8
8
|
const wrapDescription = (text) => wrapHelpText(text, Math.max(1, helpWidth() - SPACE_WIDTH - DESCRIPTION_GUTTER));
|
|
@@ -285,5 +285,4 @@ const isBareParentCommand = (argv, positionals) => {
|
|
|
285
285
|
const path = internals.getContext().commands;
|
|
286
286
|
return path.length > 0 && positionals.length === path.length && internals.getCommandInstance().getCommands().length > 0;
|
|
287
287
|
};
|
|
288
|
-
//#endregion
|
|
289
288
|
export { UsageError, failOnUsageError, isBareParentCommand, showHelp, showUsageErrorHelp };
|
package/dist/human_table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isObject } from "./utils/string.js";
|
|
2
2
|
import chalk from "chalk";
|
|
3
|
-
|
|
3
|
+
// src/human_table.ts
|
|
4
4
|
const GUTTER = 2;
|
|
5
5
|
const MIN_COL = 3;
|
|
6
6
|
const ELLIPSIS = "...";
|
|
@@ -225,5 +225,4 @@ function charWidth(code) {
|
|
|
225
225
|
}
|
|
226
226
|
return 1;
|
|
227
227
|
}
|
|
228
|
-
//#endregion
|
|
229
228
|
export { displayWidth, formatHumanChunk, parseColumns, resolveOutputWidth, stripAnsi, titleCaseField, truncateTo };
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import { log } from "./log.js";
|
|
|
2
2
|
import pkg_default from "./pkg.js";
|
|
3
3
|
import { UnreadableResponseError, codeFromBody, isNeonApiError, messageFromBody } from "./api.js";
|
|
4
4
|
import { getAuthContext } from "./auth_context.js";
|
|
5
|
-
import { r as defaultDir } from "./_chunks/paths-
|
|
5
|
+
import { r as defaultDir } from "./_chunks/paths-B55ZfOg1.js";
|
|
6
6
|
import { ensureConfigDir } from "./config.js";
|
|
7
7
|
import { currentContextFile, enrichFromContext } from "./context.js";
|
|
8
8
|
import { NETWORK_ERROR_MESSAGE, isNetworkError, matchErrorCode } from "./errors.js";
|
|
9
9
|
import { analyticsMiddleware, closeAnalytics, initAnalyticsClientMiddleware, isAnalyticsActive, recordCommandSuccessExtras, sendError, takeCommandSuccessExtras, trackCommandSuccess } from "./analytics.js";
|
|
10
10
|
import { AuthRefreshError, defaultClientID } from "./auth.js";
|
|
11
11
|
import { getCliName } from "./utils/cli_name.js";
|
|
12
|
-
import { c as ensureAuth } from "./_chunks/auth-
|
|
12
|
+
import { c as ensureAuth } from "./_chunks/auth-DPSDYYtG.js";
|
|
13
13
|
import { recoverFrom401 } from "./auth_recovery.js";
|
|
14
14
|
import { UsageError, failOnUsageError, isBareParentCommand, showHelp, showUsageErrorHelp } from "./help.js";
|
|
15
15
|
import { lazyCommands, preloadCommand } from "./commands/manifest.js";
|
|
@@ -21,7 +21,7 @@ import { collapseRepeatedFlags, declaredOptions } from "./utils/repeated_flags.j
|
|
|
21
21
|
import { stagingFeaturesEnabledForArgv } from "./utils/staging.js";
|
|
22
22
|
import yargs from "yargs";
|
|
23
23
|
import { hideBin } from "yargs/helpers";
|
|
24
|
-
|
|
24
|
+
// src/index.ts
|
|
25
25
|
const NO_SUBCOMMANDS_VERBS = [
|
|
26
26
|
"api",
|
|
27
27
|
"auth",
|
|
@@ -250,5 +250,4 @@ async function handleError(msg, err, canRetry) {
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
})();
|
|
253
|
-
//#endregion
|
|
254
253
|
export {};
|
package/dist/init/agents.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, getAgentDisplayName, listMcpAgentIds, resolveAddMcpAgentId, tryResolveAddMcpAgentId, uniqueAgentIds } from "../mcp/agents.js";
|
|
2
2
|
import { agents } from "add-mcp";
|
|
3
|
-
|
|
3
|
+
// src/init/agents.ts
|
|
4
4
|
const SKILLS_AGENT_BY_TYPE = {
|
|
5
5
|
cursor: "cursor",
|
|
6
6
|
vscode: "github-copilot",
|
|
@@ -47,5 +47,4 @@ function skillsPickerOptions() {
|
|
|
47
47
|
hint: "agent skills"
|
|
48
48
|
}));
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { agentPickerHint, agentSupportsHttpMcp, agentSupportsProjectMcp, detectInstalledAgents, getAgentDisplayName, getSkillsAgentName, listMcpAgentIds, mcpPickerOptions, resolveAddMcpAgentId, skillsPickerOptions, supportsSkills, tryResolveAddMcpAgentId, uniqueAgentIds };
|
package/dist/init/auth.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isNeonApiError } from "../api.js";
|
|
2
|
-
import { r as defaultDir } from "../_chunks/paths-
|
|
2
|
+
import { r as defaultDir } from "../_chunks/paths-B55ZfOg1.js";
|
|
3
3
|
import "../config.js";
|
|
4
4
|
import "../auth.js";
|
|
5
|
-
import { c as ensureAuth } from "../_chunks/auth-
|
|
5
|
+
import { c as ensureAuth } from "../_chunks/auth-DPSDYYtG.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { c as pull } from "../_chunks/env-
|
|
8
|
-
import { c as setupNeonMcp } from "../_chunks/mcp-
|
|
9
|
-
|
|
7
|
+
import { c as pull } from "../_chunks/env-BOt9AZ1j.js";
|
|
8
|
+
import { c as setupNeonMcp } from "../_chunks/mcp-BznTRK3w.js";
|
|
9
|
+
// src/init/auth.ts
|
|
10
10
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
|
11
11
|
const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
|
|
12
12
|
/**
|
|
@@ -77,5 +77,4 @@ const pullInitEnv = async (props) => {
|
|
|
77
77
|
throw authenticationFailed();
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
//#endregion
|
|
81
80
|
export { pullInitEnv, runAuthenticatedMcp };
|
package/dist/init/bootstrap.js
CHANGED
|
@@ -2,7 +2,7 @@ import { chmodSync, existsSync, lstatSync, mkdirSync, readdirSync, rmSync, statS
|
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import YAML from "yaml";
|
|
4
4
|
import { gunzipSync } from "fflate";
|
|
5
|
-
|
|
5
|
+
// src/init/bootstrap.ts
|
|
6
6
|
/** Default features when a template doesn't specify `requires`. */
|
|
7
7
|
const DEFAULT_REQUIRES = ["database"];
|
|
8
8
|
/**
|
|
@@ -368,5 +368,4 @@ const scaffoldTemplate = async (template, targetDir, options = {}) => {
|
|
|
368
368
|
}
|
|
369
369
|
return files.length;
|
|
370
370
|
};
|
|
371
|
-
//#endregion
|
|
372
371
|
export { BootstrapInputError, FALLBACK_TEMPLATES, downloadTemplate, ensureTargetUsable, fetchTemplates, findTemplate, parseManifest, parseTar, scaffoldTemplate, selectTemplateFiles, templateIds };
|
package/dist/init/cancelled.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/init/cancelled.ts
|
|
2
2
|
var InitCancelled = class extends Error {
|
|
3
3
|
constructor() {
|
|
4
4
|
super("Aborted.");
|
|
@@ -37,5 +37,4 @@ const restoreCursor = () => {
|
|
|
37
37
|
const restoreCursorVisibilityOnAbort = (state) => {
|
|
38
38
|
if (state.aborted) process.stdout.write("\x1B[?25h");
|
|
39
39
|
};
|
|
40
|
-
//#endregion
|
|
41
40
|
export { InitCancelled, raceSigint, restoreCursor, restoreCursorVisibilityOnAbort };
|
package/dist/init/choices.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FUNCTION_SLUG } from "../config_template.js";
|
|
2
|
-
import { l as functionBaseUrlKey } from "../_chunks/env-
|
|
3
|
-
|
|
2
|
+
import { l as functionBaseUrlKey } from "../_chunks/env-JgoSsmyt.js";
|
|
3
|
+
// src/init/choices.ts
|
|
4
4
|
const INIT_CONFIG_SERVICES_CONFLICT = "--no-config cannot be combined with --services.";
|
|
5
5
|
const resolveInitConfigChoice = (input) => {
|
|
6
6
|
if (input.flag === false && input.services !== void 0) throw new Error(INIT_CONFIG_SERVICES_CONFLICT);
|
|
@@ -41,5 +41,4 @@ const initEnvPullAfterConfig = (input) => {
|
|
|
41
41
|
envKeys: input.declared.includes("functions") ? [functionBaseUrlKey(FUNCTION_SLUG)] : []
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { INIT_CONFIG_SERVICES_CONFLICT, configPlanFromResolution, initEnvPullAfterConfig, resolveInitConfigChoice };
|
package/dist/init/chrome.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isCi } from "../env.js";
|
|
2
2
|
import { HEADING_CANCELLED, HEADING_COMPLETE, HEADING_FAILED, HEADING_PENDING, INIT_SUBTITLE } from "./copy.js";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
|
|
4
|
+
// src/init/chrome.ts
|
|
5
5
|
const NEON_GREEN = "#4BB578";
|
|
6
6
|
const INIT_BANNER_LINES = [
|
|
7
7
|
" ██╗ ██╗██████╗ ██████╗ ██╗ ██╗",
|
|
@@ -118,5 +118,4 @@ const headingForKind = (kind) => {
|
|
|
118
118
|
default: return kind;
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
//#endregion
|
|
122
121
|
export { INIT_BANNER_LINES, NEON_GREEN, agentSetupDoneLabel, agentSetupLabel, agentsRowValue, configRowValue, configSummaryLabel, formatInitBanner, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner };
|
package/dist/init/copy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCliName } from "../utils/cli_name.js";
|
|
2
|
-
|
|
2
|
+
// src/init/copy.ts
|
|
3
3
|
const INIT_SUBTITLE = "Set up coding agents and this directory for Neon.";
|
|
4
4
|
const MODE_MESSAGE = "How would you like to set up Neon?";
|
|
5
5
|
const MODE_RECOMMENDED_TITLE = "Recommended setup";
|
|
@@ -158,6 +158,17 @@ const mcpKeyFailedNext = (reason, mcp) => [
|
|
|
158
158
|
"Or with OAuth:",
|
|
159
159
|
`${mcp} --oauth`
|
|
160
160
|
];
|
|
161
|
+
const AGENTS_NOT_INSTALLED = "not installed";
|
|
162
|
+
const TOOLING_FAILED = {
|
|
163
|
+
plugins: "The Neon plugin was not installed. Retry with:",
|
|
164
|
+
skills: "Neon skills were not installed. Retry with:",
|
|
165
|
+
mcp: "The Neon MCP server was not configured. Retry with:"
|
|
166
|
+
};
|
|
167
|
+
const toolingFailedNext = (failures) => failures.flatMap((failure, index) => [
|
|
168
|
+
...index > 0 ? [""] : [],
|
|
169
|
+
TOOLING_FAILED[failure.kind],
|
|
170
|
+
failure.command
|
|
171
|
+
]);
|
|
161
172
|
const mcpAfterLinkNext = (mcp) => ["Then configure the Neon MCP server for that project:", mcp];
|
|
162
173
|
const envPullFailedNext = () => ({
|
|
163
174
|
heading: HEADING_FAILED,
|
|
@@ -173,5 +184,4 @@ const headingForOutcome = (outcome) => {
|
|
|
173
184
|
default: return outcome;
|
|
174
185
|
}
|
|
175
186
|
};
|
|
176
|
-
|
|
177
|
-
export { AGENT_DETECTED_DESCRIPTION, AGENT_MCP_PICKER_MESSAGE, AGENT_MCP_SKIP_MESSAGE, AGENT_OTHER_DESCRIPTION, AGENT_PICKER_MESSAGE, AGENT_PLUGIN_SKIP_MESSAGE, AGENT_SETUP_MESSAGE, AGENT_SETUP_PLUGIN_DESCRIPTION, AGENT_SETUP_PLUGIN_TITLE, AGENT_SETUP_SKILLS_DESCRIPTION, AGENT_SETUP_SKILLS_TITLE, AGENT_SETUP_SKIP_DESCRIPTION, AGENT_SETUP_SKIP_TITLE, AGENT_SKILLS_PICKER_MESSAGE, AGENT_SKILLS_SKIP_MESSAGE, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, CONFIG_CONFIRM_HINT, CONFIG_CONFIRM_MESSAGE, HEADING_CANCELLED, HEADING_COMPLETE, HEADING_FAILED, HEADING_PENDING, INIT_NEEDS_YES, INIT_SUBTITLE, MCP_API_KEY_NEEDS_AUTH, MCP_AUTH_API_KEY_DESCRIPTION, MCP_AUTH_API_KEY_TITLE, MCP_AUTH_MESSAGE, MCP_AUTH_OAUTH_DESCRIPTION, MCP_AUTH_OAUTH_TITLE, MCP_OAUTH_FALLBACK, MCP_SCOPED_NEEDS_PROJECT, MCP_SCOPE_GLOBAL_DESCRIPTION, MCP_SCOPE_GLOBAL_TITLE, MCP_SCOPE_MESSAGE, MCP_SCOPE_PROJECT_DESCRIPTION, MCP_SCOPE_PROJECT_TITLE, MODE_CUSTOM_DESCRIPTION, MODE_CUSTOM_TITLE, MODE_MESSAGE, MODE_RECOMMENDED_DESCRIPTION, MODE_RECOMMENDED_TITLE, NON_TTY_AGENT_SETUP, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, NO_AGENT_SETUP_CONFLICT, PACKAGE_MANAGER_MESSAGE, PROGRESS, PROJECT_PINNED_OFFLINE, PROJECT_SETUP_CLAIMABLE_DESCRIPTION, PROJECT_SETUP_CLAIMABLE_TITLE, PROJECT_SETUP_LINK_DESCRIPTION, PROJECT_SETUP_LINK_TITLE, PROJECT_SETUP_MESSAGE, SERVICES_HINT, SERVICES_MESSAGE, SKILLS_PICKER_MESSAGE, agentMissingCommandDescription, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, headingForOutcome, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, unattendedUnauthedNext };
|
|
187
|
+
export { AGENTS_NOT_INSTALLED, AGENT_DETECTED_DESCRIPTION, AGENT_MCP_PICKER_MESSAGE, AGENT_MCP_SKIP_MESSAGE, AGENT_OTHER_DESCRIPTION, AGENT_PICKER_MESSAGE, AGENT_PLUGIN_SKIP_MESSAGE, AGENT_SETUP_MESSAGE, AGENT_SETUP_PLUGIN_DESCRIPTION, AGENT_SETUP_PLUGIN_TITLE, AGENT_SETUP_SKILLS_DESCRIPTION, AGENT_SETUP_SKILLS_TITLE, AGENT_SETUP_SKIP_DESCRIPTION, AGENT_SETUP_SKIP_TITLE, AGENT_SKILLS_PICKER_MESSAGE, AGENT_SKILLS_SKIP_MESSAGE, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, CONFIG_CONFIRM_HINT, CONFIG_CONFIRM_MESSAGE, HEADING_CANCELLED, HEADING_COMPLETE, HEADING_FAILED, HEADING_PENDING, INIT_NEEDS_YES, INIT_SUBTITLE, MCP_API_KEY_NEEDS_AUTH, MCP_AUTH_API_KEY_DESCRIPTION, MCP_AUTH_API_KEY_TITLE, MCP_AUTH_MESSAGE, MCP_AUTH_OAUTH_DESCRIPTION, MCP_AUTH_OAUTH_TITLE, MCP_OAUTH_FALLBACK, MCP_SCOPED_NEEDS_PROJECT, MCP_SCOPE_GLOBAL_DESCRIPTION, MCP_SCOPE_GLOBAL_TITLE, MCP_SCOPE_MESSAGE, MCP_SCOPE_PROJECT_DESCRIPTION, MCP_SCOPE_PROJECT_TITLE, MODE_CUSTOM_DESCRIPTION, MODE_CUSTOM_TITLE, MODE_MESSAGE, MODE_RECOMMENDED_DESCRIPTION, MODE_RECOMMENDED_TITLE, NON_TTY_AGENT_SETUP, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, NO_AGENT_SETUP_CONFLICT, PACKAGE_MANAGER_MESSAGE, PROGRESS, PROJECT_PINNED_OFFLINE, PROJECT_SETUP_CLAIMABLE_DESCRIPTION, PROJECT_SETUP_CLAIMABLE_TITLE, PROJECT_SETUP_LINK_DESCRIPTION, PROJECT_SETUP_LINK_TITLE, PROJECT_SETUP_MESSAGE, SERVICES_HINT, SERVICES_MESSAGE, SKILLS_PICKER_MESSAGE, agentMissingCommandDescription, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, headingForOutcome, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext };
|
package/dist/init/detect.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as storeFor } from "../_chunks/credential_io-
|
|
1
|
+
import { t as storeFor } from "../_chunks/credential_io-DbeSh3Pl.js";
|
|
2
2
|
import { isCi } from "../env.js";
|
|
3
|
-
import { h as resolveProfile, u as locationOf } from "../_chunks/profiles-
|
|
4
|
-
import { i as selectCredential, t as credentialInputs } from "../_chunks/auth_selection-
|
|
3
|
+
import { h as resolveProfile, u as locationOf } from "../_chunks/profiles-DTazQtjK.js";
|
|
4
|
+
import { i as selectCredential, t as credentialInputs } from "../_chunks/auth_selection-CwGLN9Qz.js";
|
|
5
5
|
import { detectInstalledAgents, uniqueAgentIds } from "../mcp/agents.js";
|
|
6
6
|
import "./agents.js";
|
|
7
7
|
import { directoryIsEmpty } from "./plan.js";
|
|
@@ -9,7 +9,7 @@ import { detectAgent } from "./detect_host.js";
|
|
|
9
9
|
import { canPickAgentsInteractively } from "../utils/agent_picker.js";
|
|
10
10
|
import { existsSync, readdirSync } from "node:fs";
|
|
11
11
|
import { detectProjectAgents } from "add-mcp";
|
|
12
|
-
|
|
12
|
+
// src/init/detect.ts
|
|
13
13
|
const listingHasCredentials = (configDir, profile) => {
|
|
14
14
|
try {
|
|
15
15
|
return storeFor(configDir).inspect(locationOf(resolveProfile(configDir, profile))).credentials !== null;
|
|
@@ -54,5 +54,4 @@ const detectInitEnvironment = async (options) => {
|
|
|
54
54
|
ci: isCi()
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
//#endregion
|
|
58
57
|
export { collectDetectedAgents, detectInitEnvironment, hasLocalCredentials };
|
package/dist/init/detect_host.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/init/detect_host.ts
|
|
2
2
|
const CLAUDE_ENV = ["CLAUDECODE", "CLAUDE_CODE_CHILD_SESSION"];
|
|
3
3
|
const CURSOR_ENV = [
|
|
4
4
|
"CURSOR_TRACE_ID",
|
|
@@ -34,5 +34,4 @@ function detectAgent(env = process.env) {
|
|
|
34
34
|
if (env.TERM_PROGRAM === "vscode" || isSet(env.VSCODE_PID) || isSet(env.VSCODE_CWD)) return "vscode";
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { detectAgent };
|
package/dist/init/funnel.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import pkg_default from "../pkg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { codeFromBody, isNeonApiError } from "../api.js";
|
|
3
|
+
import { isNetworkError, matchErrorCode } from "../errors.js";
|
|
4
|
+
import { redactCredentialTokenIds, trackEvent } from "../analytics.js";
|
|
5
|
+
import { AuthRefreshError } from "../auth.js";
|
|
3
6
|
import { randomUUID } from "node:crypto";
|
|
4
|
-
|
|
7
|
+
import { stripVTControlCharacters } from "node:util";
|
|
8
|
+
// src/init/funnel.ts
|
|
5
9
|
const CLI_INIT_START = "cli_init_start";
|
|
6
10
|
const CLI_INIT_END = "cli_init_end";
|
|
7
11
|
const FLAG_ALIASES = {
|
|
@@ -70,17 +74,45 @@ const initStartProperties = (input) => ({
|
|
|
70
74
|
detected_agents: input.detection.detectedAgents,
|
|
71
75
|
ci: input.detection.ci
|
|
72
76
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
/** Longer messages are cut so one plugin CLI dump cannot dominate the event. */
|
|
78
|
+
const ERROR_MESSAGE_LIMIT = 2e3;
|
|
79
|
+
/**
|
|
80
|
+
* The `errCode` the top-level failure handler (`index.ts`) sends on `CLI Error` for the same
|
|
81
|
+
* error, so a run's `error_code` and its `CLI Error` event agree.
|
|
82
|
+
*/
|
|
83
|
+
const initErrorCode = (error) => {
|
|
84
|
+
if (error instanceof AuthRefreshError) return "AUTH_FAILED";
|
|
85
|
+
if (isNetworkError(error)) return "NETWORK_ERROR";
|
|
86
|
+
if (isNeonApiError(error)) {
|
|
87
|
+
if (error.code === "ECONNABORTED") return "REQUEST_TIMEOUT";
|
|
88
|
+
const bodyCode = codeFromBody(error.data);
|
|
89
|
+
if (error.status === 401 || bodyCode === "SSO_AUTHORIZATION_REQUIRED" || bodyCode === "SSO_ORG_CREDS_ONLY") return "AUTH_FAILED";
|
|
90
|
+
return "API_ERROR";
|
|
91
|
+
}
|
|
92
|
+
return matchErrorCode(error instanceof Error ? error.message : void 0);
|
|
93
|
+
};
|
|
94
|
+
const initErrorMessage = (error) => {
|
|
95
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
96
|
+
return redactCredentialTokenIds(stripVTControlCharacters(raw)).slice(0, ERROR_MESSAGE_LIMIT);
|
|
97
|
+
};
|
|
98
|
+
const initEndProperties = (input) => {
|
|
99
|
+
const reported = input.errors.find((entry) => entry.error === input.exitError) ?? input.errors[0];
|
|
100
|
+
return {
|
|
101
|
+
init_run_id: input.initRunId,
|
|
102
|
+
cli_version: pkg_default.version,
|
|
103
|
+
mode: input.mode,
|
|
104
|
+
agent_setup: input.agentSetup,
|
|
105
|
+
agents_installed: input.agentsInstalled,
|
|
106
|
+
link: input.link,
|
|
107
|
+
config: input.config,
|
|
108
|
+
services: input.services,
|
|
109
|
+
outcome: input.outcome,
|
|
110
|
+
error_step: reported?.step ?? null,
|
|
111
|
+
error_code: reported === void 0 ? null : initErrorCode(reported.error),
|
|
112
|
+
error_message: reported === void 0 ? null : initErrorMessage(reported.error),
|
|
113
|
+
error_steps: [...new Set(input.errors.map((entry) => entry.step))]
|
|
114
|
+
};
|
|
115
|
+
};
|
|
84
116
|
const emitInitStart = (properties) => {
|
|
85
117
|
trackEvent(CLI_INIT_START, properties);
|
|
86
118
|
};
|
|
@@ -95,8 +127,22 @@ const createInitFunnel = (initRunId = createInitRunId()) => ({
|
|
|
95
127
|
link: null,
|
|
96
128
|
config: null,
|
|
97
129
|
services: null,
|
|
130
|
+
errors: [],
|
|
131
|
+
exitError: void 0,
|
|
98
132
|
ended: false
|
|
99
133
|
});
|
|
134
|
+
/** Records a failure once: a deferred error rethrown at the end keeps the step it failed in. */
|
|
135
|
+
const recordInitError = (state, step, error) => {
|
|
136
|
+
if (state.errors.some((entry) => entry.error === error)) return;
|
|
137
|
+
state.errors.push({
|
|
138
|
+
step,
|
|
139
|
+
error
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
const recordInitExit = (state, step, error) => {
|
|
143
|
+
recordInitError(state, step, error);
|
|
144
|
+
state.exitError = error;
|
|
145
|
+
};
|
|
100
146
|
const finishInitFunnel = (state, outcome, analytics) => {
|
|
101
147
|
if (state.ended || !analytics) return;
|
|
102
148
|
state.ended = true;
|
|
@@ -108,8 +154,9 @@ const finishInitFunnel = (state, outcome, analytics) => {
|
|
|
108
154
|
link: state.link,
|
|
109
155
|
config: state.config,
|
|
110
156
|
services: state.services,
|
|
111
|
-
outcome
|
|
157
|
+
outcome,
|
|
158
|
+
errors: state.errors,
|
|
159
|
+
exitError: state.exitError
|
|
112
160
|
}));
|
|
113
161
|
};
|
|
114
|
-
|
|
115
|
-
export { CLI_INIT_END, CLI_INIT_START, createInitFunnel, createInitRunId, emitInitEnd, emitInitStart, finishInitFunnel, initEndProperties, initFlagsFromArgv, initStartProperties };
|
|
162
|
+
export { CLI_INIT_END, CLI_INIT_START, createInitFunnel, createInitRunId, emitInitEnd, emitInitStart, finishInitFunnel, initEndProperties, initErrorCode, initErrorMessage, initFlagsFromArgv, initStartProperties, recordInitError, recordInitExit };
|
package/dist/init/link.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isNeonApiError } from "../api.js";
|
|
2
|
-
import { r as defaultDir } from "../_chunks/paths-
|
|
2
|
+
import { r as defaultDir } from "../_chunks/paths-B55ZfOg1.js";
|
|
3
3
|
import "../config.js";
|
|
4
4
|
import "../auth.js";
|
|
5
|
-
import { c as ensureAuth } from "../_chunks/auth-
|
|
5
|
+
import { c as ensureAuth } from "../_chunks/auth-DPSDYYtG.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { s as runLink } from "../_chunks/link-
|
|
8
|
-
|
|
7
|
+
import { s as runLink } from "../_chunks/link-CcwTXRny.js";
|
|
8
|
+
// src/init/link.ts
|
|
9
9
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
|
10
10
|
const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
|
|
11
11
|
const runAuthenticatedLink = async (props) => {
|
|
@@ -34,5 +34,4 @@ const runAuthenticatedLink = async (props) => {
|
|
|
34
34
|
throw authenticationFailed();
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { runAuthenticatedLink };
|
package/dist/init/mode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INIT_NEEDS_YES, NON_TTY_AGENT_SETUP, NO_AGENT_SETUP_CONFLICT } from "./copy.js";
|
|
2
|
-
|
|
2
|
+
// src/init/mode.ts
|
|
3
3
|
const hasInitMcpFlags = (input) => input.mcpConfigLocation !== void 0 || input.mcpAuth !== void 0 || input.mcpProjectScoped === true;
|
|
4
4
|
const hasSkillsFlag = (skills) => skills !== void 0 && skills.length > 0;
|
|
5
5
|
const hasCustomizingFlags = (input) => input.skipAgents || input.claimable || hasSkillsFlag(input.skills) || hasInitMcpFlags(input);
|
|
@@ -23,5 +23,4 @@ const inferInitAgentSetup = (input) => {
|
|
|
23
23
|
if (input.canAsk) return { kind: "ask" };
|
|
24
24
|
throw new Error(NON_TTY_AGENT_SETUP);
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { assertAgentSetupFlags, hasInitMcpFlags, inferInitAgentSetup, resolveInitMode };
|
package/dist/init/plan.js
CHANGED
|
@@ -6,7 +6,7 @@ import { pluginsInstallableAgents } from "../plugins/targets.js";
|
|
|
6
6
|
import { skillsInstallableAgents } from "../skills/targets.js";
|
|
7
7
|
import { agentArgv } from "../utils/agent_flag.js";
|
|
8
8
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
9
|
-
|
|
9
|
+
// src/init/plan.ts
|
|
10
10
|
const directoryIsEmpty = (names) => names.filter((name) => name !== ".git").length === 0;
|
|
11
11
|
const bootstrapInitStep = (yes, agents = []) => [...yes ? [
|
|
12
12
|
"bootstrap",
|
|
@@ -385,5 +385,4 @@ const resolveInitAgentSetup = async (input) => {
|
|
|
385
385
|
if (input.interactive) return input.pick();
|
|
386
386
|
throw new Error(INIT_NEEDS_YES_OR_TERMINAL);
|
|
387
387
|
};
|
|
388
|
-
//#endregion
|
|
389
388
|
export { FALLBACK_SKILLS_AGENTS, INIT_NEEDS_YES_OR_TERMINAL, NAMED_AGENTS_MIXED, NAMED_AGENTS_UNSUPPORTED, assertNamedAgentTooling, bootstrapInitStep, chooseYesAgentTooling, collectYesAgents, directoryIsEmpty, funnelAgentSetup, initPluginAgents, initSkillsMcpAgents, initYesSupportedAgents, linkInputArgv, namedAgentsMixedMessage, namedAgentsNeedSplit, noDetectedAgentsMessage, planAgentSteps, planConfigInitStep, planInitToolingSteps, planLinkStep, planToolingSteps, planYesAgentSteps, postScaffoldActions, projectContextFile, recommendedTooling, resolveInitAgentSetup, resolveNamedAgents, resolveYesAgentList, rewriteUnknownAgentArg, splitInitTooling };
|