@spacefast/common 0.0.26 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/connect-targets.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -1
- package/dist/agents/private-key-oauth.js +124 -33
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +1 -2
- package/dist/brand-assets.js +4 -7
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +55 -28
- package/dist/config/domains.js +85 -41
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +21 -27
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +70 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.js +7 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +186 -7
- package/dist/contracts/builds.js +75 -21
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +45 -35
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +18 -29
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +17 -0
- package/dist/contracts/crons.js +33 -15
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +6 -10
- package/dist/contracts/docs.js +5 -13
- package/dist/contracts/domains.d.ts +499 -102
- package/dist/contracts/domains.js +169 -58
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +26 -26
- package/dist/contracts/enums.js +61 -54
- package/dist/contracts/error-code-meta.d.ts +269 -7
- package/dist/contracts/error-code-meta.js +80 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +78 -16
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +51 -64
- package/dist/contracts/feature-lifecycle.d.ts +70 -14
- package/dist/contracts/feature-lifecycle.js +86 -15
- package/dist/contracts/features.d.ts +100 -37
- package/dist/contracts/features.js +21 -27
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +218 -211
- package/dist/contracts/functions.js +273 -260
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +64 -56
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +4 -1
- package/dist/contracts/internal.d.ts +5 -4
- package/dist/contracts/internal.js +12 -3
- package/dist/contracts/mcp.d.ts +17 -0
- package/dist/contracts/mcp.js +23 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +112 -10
- package/dist/contracts/oauth-resources.js +116 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +11 -5
- package/dist/contracts/pages.d.ts +29 -5
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +116 -18
- package/dist/contracts/publish-archive.js +6 -3
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +3 -3
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/repository-connections.js +6 -2
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +145 -21
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +112 -35
- package/dist/contracts/runtime-api.js +86 -66
- package/dist/contracts/runtime-app.d.ts +11 -21
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +45 -19
- package/dist/contracts/runtime-db.js +85 -20
- package/dist/contracts/runtime-purge.js +3 -5
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +14 -14
- package/dist/contracts/runtime-storage.js +28 -13
- package/dist/contracts/sf-config-v1.d.ts +14 -18
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +235 -28
- package/dist/contracts/space-config.js +246 -91
- package/dist/contracts/spaces.d.ts +360 -255
- package/dist/contracts/spaces.js +190 -122
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +435 -186
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +3 -0
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -6
- package/dist/contracts/superadmin-tenants.js +32 -7
- package/dist/contracts/superadmin.d.ts +98 -16
- package/dist/contracts/superadmin.js +63 -10
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +44 -34
- package/dist/contracts/teams.d.ts +72 -9
- package/dist/contracts/teams.js +84 -25
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +1 -0
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +57 -64
- package/dist/contracts/zero.js +68 -66
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +11 -17
- package/dist/docs/agent-prose.js +62 -37
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +336 -436
- package/dist/docs/catalog.d.ts +147 -89
- package/dist/docs/catalog.js +157 -42
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +281 -16
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +117 -117
- package/dist/docs/skills.js +120 -72
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +16 -0
- package/dist/utils/build-settings.js +63 -17
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +3 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +2 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +123 -57
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +4 -7
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +15 -15
- package/dist/utils/local-space-state.js +34 -23
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +3 -5
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +4 -10
- package/dist/utils/page-colors.js +11 -35
- package/dist/utils/page-fonts.js +6 -11
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +22 -11
- package/dist/utils/pages.js +70 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +10 -23
- package/dist/utils/publish-policy.js +63 -116
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +18 -24
- package/dist/utils/space-config.d.ts +11 -14
- package/dist/utils/space-config.js +10 -16
- package/dist/utils/static-runtime-policy.d.ts +5 -8
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +17 -84
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.js +8 -14
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +7 -7
- package/dist/vocabulary.js +30 -16
- package/package.json +14 -2
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
package/dist/docs/agent-prose.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import { SPACEFAST_POSITIONING } from "../brand.js";
|
|
1
2
|
import { serviceOrigin } from "../config/domains.js";
|
|
2
|
-
// Single home for the agent-facing prose
|
|
3
|
-
//
|
|
3
|
+
// Single home for the agent-facing prose the three publish-teaching surfaces
|
|
4
|
+
// share:
|
|
4
5
|
//
|
|
5
6
|
// - packages/cli/skill.template.md (the SKILL.md router + copies)
|
|
6
7
|
// - packages/common/src/docs/agent-setup.ts (the /ai and /ai.txt page body)
|
|
7
8
|
// - spacefast/www (the agent-card / discovery prose)
|
|
8
9
|
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// placeholders during generation, and the TS surfaces import the strings.
|
|
14
|
-
//
|
|
15
|
-
// Keep these grounded in the real API receipt and the real /v1/publish flow. If
|
|
16
|
-
// the receipt shape or secret handling changes, change it here once.
|
|
10
|
+
// These are plain Markdown strings with no surface-specific framing: the skill
|
|
11
|
+
// template substitutes the `{{prose.*}}` placeholders during generation, and the
|
|
12
|
+
// TS surfaces import them. Keep them grounded in the real API receipt and the
|
|
13
|
+
// real /v1/publish flow; if either changes, change it here once.
|
|
17
14
|
const API_ORIGIN = serviceOrigin("api", "prod");
|
|
18
15
|
const PUBLISH_ENDPOINT = `${API_ORIGIN}/v1/publish`;
|
|
19
16
|
const EXCHANGE_ENDPOINT = `${API_ORIGIN}/v1/claim/exchange`;
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
17
|
+
// Secret/credential patterns excluded from a publish archive. The `find`
|
|
18
|
+
// preflight and the `zip -x` exclusions both derive from this list, so the
|
|
19
|
+
// no-install and skill copies cannot disagree.
|
|
23
20
|
export const ARCHIVE_SECRET_GLOBS = [
|
|
24
21
|
".env*",
|
|
25
22
|
".npmrc",
|
|
@@ -58,10 +55,7 @@ function findExpr(globs) {
|
|
|
58
55
|
.map((glob) => (glob.includes("/") ? `-path "${glob}"` : `-name "${glob}"`))
|
|
59
56
|
.join(" -o ");
|
|
60
57
|
}
|
|
61
|
-
/**
|
|
62
|
-
* The credential rules every surface must repeat. Treat tokens as secrets, keep
|
|
63
|
-
* them out of logs and transcripts, and never echo them back.
|
|
64
|
-
*/
|
|
58
|
+
/** The credential rules every surface must repeat. */
|
|
65
59
|
export const SECRET_RULES_PROSE = [
|
|
66
60
|
"Treat space keys, upload tokens, device codes, and API keys as credentials. Do not print",
|
|
67
61
|
"them, paste them into chat, commit them, archive them, or include them in shared logs. Avoid",
|
|
@@ -70,6 +64,10 @@ export const SECRET_RULES_PROSE = [
|
|
|
70
64
|
"clear them after use, and avoid durable auth unless the user explicitly asks.",
|
|
71
65
|
].join("\n");
|
|
72
66
|
export const POSITIONING_PROSE = [
|
|
67
|
+
// What the product is, before any claim about it. One constant, shared with
|
|
68
|
+
// the dashboard's copied page context (see docs/page-context-prompt.ts).
|
|
69
|
+
SPACEFAST_POSITIONING,
|
|
70
|
+
"",
|
|
73
71
|
"Spacefast is the best place to share AI artifacts.",
|
|
74
72
|
"Spaces serve files directly; app code runs only through a declared Zero or Functions runtime.",
|
|
75
73
|
"",
|
|
@@ -94,16 +92,18 @@ export const FAILURE_CONDUCT_PROSE = [
|
|
|
94
92
|
FEEDBACK_PROSE,
|
|
95
93
|
].join("\n");
|
|
96
94
|
export const LANE_PICKER_PROSE = [
|
|
97
|
-
"Pick the lane by environment:
|
|
98
|
-
"filesystem means
|
|
99
|
-
"
|
|
95
|
+
"Pick the lane by environment: a one-off publish means curl; a git checkout means the push.new",
|
|
96
|
+
"remote; repeat work with a filesystem means the CLI — the best setup, `npx -y spacefast` runs it",
|
|
97
|
+
"with no install, and `sf plugins` installs your client's plugin; no filesystem means hosted MCP;",
|
|
98
|
+
"CI means a machine OAuth client. After success, recommend the best next-time setup for the",
|
|
99
|
+
"user's client.",
|
|
100
100
|
].join("\n");
|
|
101
101
|
export const HOW_TO_RESEARCH_PROSE = [
|
|
102
102
|
"For an error, fetch the problem document's `type` URL. For capability questions, search the OpenAPI catalog with `execute` or append",
|
|
103
103
|
"`.md` to website docs URLs. For contracts, read `publish-spec.json` or OpenAPI. Never guess",
|
|
104
104
|
"limits: publish, then read diagnostics.",
|
|
105
105
|
].join("\n");
|
|
106
|
-
/** Curl/API skill lane: docs URLs only
|
|
106
|
+
/** Curl/API skill lane: docs URLs only, no MCP or CLI tools required. */
|
|
107
107
|
export const HOW_TO_RESEARCH_API_PROSE = [
|
|
108
108
|
"For an error, fetch the problem document's `type` URL. For capability questions, append `.md` to website docs",
|
|
109
109
|
"URLs (for example `https://spacefast.com/docs/agents.md`) or read",
|
|
@@ -112,8 +112,9 @@ export const HOW_TO_RESEARCH_API_PROSE = [
|
|
|
112
112
|
].join("\n");
|
|
113
113
|
/** MCP plugin skill lane: prefer skills for workflows and execute for the OpenAPI catalog. */
|
|
114
114
|
export const HOW_TO_RESEARCH_MCP_PROSE = [
|
|
115
|
-
"For an error, fetch the problem document's `type` URL when present. For workflows
|
|
116
|
-
"
|
|
115
|
+
"For an error, fetch the problem document's `type` URL when present. For workflows and how-to",
|
|
116
|
+
"recipes, call `search_docs`; the `skills` tool serves the `execute` guide, not workflow recipes.",
|
|
117
|
+
"For capability questions, use `execute` with `tools.search`.",
|
|
117
118
|
"For contracts, read `publish-spec.json` or OpenAPI via docs. Never guess limits: publish,",
|
|
118
119
|
"then inspect status or diagnostics through `execute`.",
|
|
119
120
|
].join("\n");
|
|
@@ -128,9 +129,8 @@ export const ENV_NOTES_API_PROSE = [
|
|
|
128
129
|
"https://spacefast.com/docs/agents.",
|
|
129
130
|
].join("\n");
|
|
130
131
|
/**
|
|
131
|
-
* The CHECK verb:
|
|
132
|
-
*
|
|
133
|
-
* anonymous space instead of a new version.
|
|
132
|
+
* The CHECK verb: look for an existing space before creating one, so a returning
|
|
133
|
+
* agent publishes a new version instead of a duplicate anonymous space.
|
|
134
134
|
*/
|
|
135
135
|
export const CHECK_BEFORE_PUBLISH_PROSE = [
|
|
136
136
|
"Before creating a space, check whether this project already has one:",
|
|
@@ -220,6 +220,34 @@ export const SAVE_STATE_MCP_PROSE = [
|
|
|
220
220
|
* The UPDATE verb: a new version to the SAME space. Never re-run the
|
|
221
221
|
* first-publish recipe when saved state exists.
|
|
222
222
|
*/
|
|
223
|
+
/*
|
|
224
|
+
* Push to deploy. Written for an agent that is already in a checkout, where a
|
|
225
|
+
* push is fewer moves than an upload — and where the receipt comes back in the
|
|
226
|
+
* push output, so there is no second call to learn the URL.
|
|
227
|
+
*
|
|
228
|
+
* The GitHub note is not an aside: a space bound to a GitHub repository refuses
|
|
229
|
+
* direct pushes, and an agent that does not know that reads the refusal as a
|
|
230
|
+
* broken remote instead of as the answer it is.
|
|
231
|
+
*/
|
|
232
|
+
export const PUSH_TO_DEPLOY_PROSE = [
|
|
233
|
+
"A space's git remote is a real remote, and pushing to it publishes. Every publish receipt",
|
|
234
|
+
"and the Space resource carry `git.remoteUrl`; authenticate as HTTP Basic user `t` with the",
|
|
235
|
+
"space key or an API key as the password. The same key you already have works — publishing",
|
|
236
|
+
"and pushing are one credential, not two.",
|
|
237
|
+
"",
|
|
238
|
+
"```bash",
|
|
239
|
+
"git remote add spacefast https://t:<key>@push.new/<space-slug>.git",
|
|
240
|
+
"git push spacefast main",
|
|
241
|
+
"```",
|
|
242
|
+
"",
|
|
243
|
+
"The push output is the receipt: it reports the live URL, the immutable version URL, and —",
|
|
244
|
+
"for an anonymous space — the claim link and its expiry, as `remote:` lines. Report those to",
|
|
245
|
+
"the user the same way you would report a publish receipt. A deploy that outruns the push",
|
|
246
|
+
"prints a status URL instead and finishes on its own; the push still exits 0.",
|
|
247
|
+
"",
|
|
248
|
+
"If `git.managedBy` is `github`, this space deploys from `git.repository` and a direct push is",
|
|
249
|
+
"refused. Push to that GitHub repository instead, or tell the user to disconnect GitHub first.",
|
|
250
|
+
].join("\n");
|
|
223
251
|
export const UPDATE_SPACE_PROSE = [
|
|
224
252
|
"To publish a new version of an existing space, send the same `spaceId` with bearer auth —",
|
|
225
253
|
"never re-run the first-publish recipe when saved state exists:",
|
|
@@ -256,7 +284,7 @@ export const CONTINUE_AFTER_CLAIM_PROSE = [
|
|
|
256
284
|
"Save `data.credential.accessToken` into `.spacefast/state.json` (replace the `claimToken`",
|
|
257
285
|
'field with `"accessToken"`), then retry the publish with the new bearer. The exchange works',
|
|
258
286
|
"exactly once; if it returns `continuation_used` or `continuation_unavailable`, ask the user",
|
|
259
|
-
"to create an API key in the dashboard (
|
|
287
|
+
"to create an API key in the dashboard (team → Agents → API keys).",
|
|
260
288
|
].join("\n");
|
|
261
289
|
const LEXICAL_PUBLISH_PATH_PREFLIGHT = [
|
|
262
290
|
'case "$publish_target" in /*) check_path="$publish_target" ;; *) check_path="$PWD/$publish_target" ;; esac',
|
|
@@ -322,7 +350,7 @@ const SECURE_ARCHIVE_RECIPE = [
|
|
|
322
350
|
];
|
|
323
351
|
/**
|
|
324
352
|
* The zero-install publish sequence: a replay-safe curl loop for a file, a
|
|
325
|
-
* secret-preflighted zip for a folder. This is the load-bearing rung 0
|
|
353
|
+
* secret-preflighted zip for a folder. This is the load-bearing rung 0. An
|
|
326
354
|
* agent that stops here must still succeed.
|
|
327
355
|
*/
|
|
328
356
|
export const PUBLISH_SEQUENCE_PROSE = [
|
|
@@ -376,7 +404,7 @@ export const PUBLISH_SEQUENCE_PROSE = [
|
|
|
376
404
|
* What the JSON publish receipt contains and how to read it. The receipt is the
|
|
377
405
|
* source of truth; never invent a separate success signal.
|
|
378
406
|
*/
|
|
379
|
-
export const
|
|
407
|
+
export const RECEIPT_CONTRACT_PROSE = [
|
|
380
408
|
"The JSON receipt is the source of truth:",
|
|
381
409
|
"",
|
|
382
410
|
"- `data.space.liveUrl` — the live URL.",
|
|
@@ -422,18 +450,14 @@ export const SIGNED_UPLOAD_PROSE = [
|
|
|
422
450
|
"For each `data.upload.targets[]`, send `target.method` to `target.url` with `target.headers`.",
|
|
423
451
|
'If `target.body.kind` is `url`, send JSON `{ "url": target.body.url }`; otherwise send the',
|
|
424
452
|
"local file bytes for `target.path`. Then call `data.links.finalize` and share the final receipt.",
|
|
425
|
-
"If the session expires or only a page of files is returned, follow `data.links.
|
|
453
|
+
"If the session expires or only a page of files is returned, follow `data.links.refresh`.",
|
|
426
454
|
"",
|
|
427
455
|
"A manifest entry may name a `sourceUrl`, so bytes that already live on a public HTTPS URL never",
|
|
428
456
|
"have to round-trip through the agent. Do not base64 large archives into chat or MCP tool arguments.",
|
|
429
457
|
].join("\n");
|
|
430
458
|
/**
|
|
431
|
-
* Named fragments for the skill-template generator
|
|
432
|
-
* `{{prose
|
|
433
|
-
* `{{prose.receiptShape}}`, `{{prose.signedUpload}}`,
|
|
434
|
-
* `{{prose.checkBeforePublish}}`, `{{prose.saveState}}`,
|
|
435
|
-
* `{{prose.updateSpace}}`, and `{{prose.continueAfterClaim}}` placeholders;
|
|
436
|
-
* generate-skill.mjs substitutes these.
|
|
459
|
+
* Named fragments for the skill-template generator: the templates carry
|
|
460
|
+
* `{{prose.<key>}}` placeholders and generate-skill.mjs substitutes these.
|
|
437
461
|
*/
|
|
438
462
|
export const AGENT_PROSE = {
|
|
439
463
|
positioning: POSITIONING_PROSE,
|
|
@@ -441,7 +465,7 @@ export const AGENT_PROSE = {
|
|
|
441
465
|
explainToUser: EXPLAIN_TO_USER_PROSE,
|
|
442
466
|
failureConduct: FAILURE_CONDUCT_PROSE,
|
|
443
467
|
publishSequence: PUBLISH_SEQUENCE_PROSE,
|
|
444
|
-
|
|
468
|
+
receiptContract: RECEIPT_CONTRACT_PROSE,
|
|
445
469
|
signedUpload: SIGNED_UPLOAD_PROSE,
|
|
446
470
|
checkBeforePublish: CHECK_BEFORE_PUBLISH_PROSE,
|
|
447
471
|
checkBeforePublishApi: CHECK_BEFORE_PUBLISH_API_PROSE,
|
|
@@ -451,6 +475,7 @@ export const AGENT_PROSE = {
|
|
|
451
475
|
saveStateApi: SAVE_STATE_API_PROSE,
|
|
452
476
|
saveStateMcp: SAVE_STATE_MCP_PROSE,
|
|
453
477
|
updateSpace: UPDATE_SPACE_PROSE,
|
|
478
|
+
pushToDeploy: PUSH_TO_DEPLOY_PROSE,
|
|
454
479
|
continueAfterClaim: CONTINUE_AFTER_CLAIM_PROSE,
|
|
455
480
|
lanePicker: LANE_PICKER_PROSE,
|
|
456
481
|
howToResearch: HOW_TO_RESEARCH_PROSE,
|
|
@@ -1,73 +1,104 @@
|
|
|
1
1
|
import { type ConnectTarget, type ConnectTargetId } from "../agents/connect-targets.js";
|
|
2
|
+
import type { AgentHandoffTarget } from "../contracts/device-auth.js";
|
|
2
3
|
export declare const agentSetupUrl: string;
|
|
3
|
-
export declare const agentSetupTextUrl: string;
|
|
4
4
|
export declare const agentSetupHostLabel: string;
|
|
5
5
|
export declare const agentSetupPrompt: string;
|
|
6
6
|
export declare const anonymousPublishCurlCommand: string;
|
|
7
|
+
export declare const AGENT_HANDOFF_TOKEN_PATTERN: RegExp;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* decline never becomes an existence oracle;
|
|
11
|
-
* supplied secret authenticates the handoff.
|
|
12
|
-
* first exchange succeeds, the second fails with this reason. Declines are terminal and never
|
|
13
|
-
* reveal whether a secret was close to correct.
|
|
9
|
+
* Decline states for the app-private redemption exchange. `invalid_handoff` is
|
|
10
|
+
* the single answer for both an unknown document ID and a wrong secret, so a
|
|
11
|
+
* decline never becomes an existence oracle; the other reasons are returned only
|
|
12
|
+
* after the supplied secret authenticates the handoff. Declines are terminal.
|
|
14
13
|
*/
|
|
15
14
|
export declare const AGENT_HANDOFF_DECLINE_REASONS: readonly ["invalid_handoff", "expired", "already_redeemed", "revoked", "client_mismatch", "origin_mismatch"];
|
|
16
15
|
export type AgentHandoffDeclineReason = (typeof AGENT_HANDOFF_DECLINE_REASONS)[number];
|
|
17
|
-
export type AgentHandoffAction = Readonly<{
|
|
18
|
-
kind: "copy";
|
|
19
|
-
label: string;
|
|
20
|
-
sensitive: boolean;
|
|
21
|
-
value: string;
|
|
22
|
-
}> | Readonly<{
|
|
23
|
-
kind: "open";
|
|
24
|
-
label: string;
|
|
25
|
-
href: string;
|
|
26
|
-
}>;
|
|
27
16
|
export type AgentHandoff = Readonly<{
|
|
28
|
-
actions: readonly AgentHandoffAction[];
|
|
29
|
-
documentUrl: string;
|
|
30
|
-
instructions: string;
|
|
31
17
|
prompt: string;
|
|
18
|
+
secret: string;
|
|
19
|
+
url: string;
|
|
32
20
|
}>;
|
|
33
21
|
/**
|
|
34
22
|
* The single shared grammar for handoff links:
|
|
35
|
-
* `<access-origin>/
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* supplied dashboard origin.
|
|
40
|
-
* Normalization is part of the contract: the input is WHATWG-URL-normalized first (backslashes,
|
|
41
|
-
* dot segments, stray tab/CR/LF, empty userinfo, case, default ports), the grammar is enforced on
|
|
42
|
-
* the normalized URL, and only the reconstructed canonical URL ever leaves this function.
|
|
43
|
-
* Dashboard minting, CLI ingestion, and control-plane validation must all use this parser so the
|
|
44
|
-
* grammar can never fork.
|
|
23
|
+
* `<access-origin>/handoffs/<token>`. The token is the bearer credential.
|
|
24
|
+
* Queries, fragments, and userinfo are forbidden. Dashboard minting, CLI
|
|
25
|
+
* ingestion, and control-plane redemption all use this parser so the grammar
|
|
26
|
+
* cannot fork.
|
|
45
27
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
documentUrl: string;
|
|
28
|
+
export type ParsedAgentHandoffUrl = Readonly<{
|
|
29
|
+
/** The canonical link, exactly as it must be presented back for redemption. */
|
|
49
30
|
handoffUrl: string;
|
|
31
|
+
/** The bearer credential carried in the last path segment. */
|
|
50
32
|
secret: string;
|
|
51
33
|
}>;
|
|
34
|
+
export declare function parseAgentHandoffUrl(value: string, expectedOrigin: string): ParsedAgentHandoffUrl;
|
|
52
35
|
/** Connect targets whose handoff continues through the CLI stdin exchange. */
|
|
53
36
|
export declare const AGENT_HANDOFF_CLI_TARGET_IDS: readonly ConnectTargetId[];
|
|
54
|
-
export declare const AGENT_HANDOFF_PREAMBLE = "Talk to the user before
|
|
55
|
-
|
|
56
|
-
export declare const AGENT_HANDOFF_FETCH_SAFETY = "Keep the original handoff link private. Fetching this clean document URL did not use or send its credential; the credential is spent only by one successful exchange. An expired, used, or revoked link fails safely, so ask the user for a fresh one from the dashboard.";
|
|
57
|
-
export declare const AGENT_HANDOFF_CREDENTIAL_HYGIENE = "Keep the private handoff URL out of commands, request URLs, logs, and replies.";
|
|
37
|
+
export declare const AGENT_HANDOFF_PREAMBLE = "Talk to the user before you install tools or publish. Confirm the file or folder to publish.";
|
|
38
|
+
export declare const AGENT_HANDOFF_CREDENTIAL_HYGIENE = "Keep the handoff URL out of command arguments, logs, and replies. It goes in exactly two places: the stdin prompt of `sf setup agent`, or the redeem request body.";
|
|
58
39
|
export declare const AGENT_HANDOFF_CLI_APPROVAL_GUIDANCE: string;
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const AGENT_HANDOFF_PUBLISH_PROSE = "After approval, confirm the selected Space and permissions, then publish only the files the user approved. Report the bare Live and immutable Version addresses separately from the private Access URL; create a scoped Link when a recipient needs access.";
|
|
40
|
+
export declare const AGENT_HANDOFF_PUBLISH_PROSE = "After login, confirm the Space and the files with the user, then publish the simplest way that fits: a one-off through `sf publish` or the publish API; a git checkout by pushing to the Space's push.new remote (`git.remoteUrl`); for repeat work the CLI is best, and `sf plugins` installs your client's plugin. Report the Live URL and the immutable Version URL; keep the private Access URL out of shared replies. Create a scoped Link only when a recipient needs access.";
|
|
61
41
|
/** One target's Connect prose: blurb, copyable setup blocks, deeplink/download lines. */
|
|
62
42
|
export declare function agentHandoffConnectSections(target: ConnectTarget): string[];
|
|
43
|
+
/**
|
|
44
|
+
* Everything the agent needs to know about the link, said once, where it acts
|
|
45
|
+
* on it. "The URL you fetched" doubles as the only reference to the bearer —
|
|
46
|
+
* the document never repeats it, so the live secret stays out of whatever the
|
|
47
|
+
* agent caches or quotes next (`renderAgentHandoffDocument` takes an ORIGIN,
|
|
48
|
+
* never a URL, so the token cannot even reach the renderer).
|
|
49
|
+
*/
|
|
50
|
+
export declare const AGENT_HANDOFF_EXCHANGE_PROSE: string;
|
|
51
|
+
/**
|
|
52
|
+
* The per-handoff setup document served from `/handoffs/<token>`.
|
|
53
|
+
*
|
|
54
|
+
* Takes the handoff's ORIGIN, never its URL: the bearer must not be able to
|
|
55
|
+
* reach this renderer, so it cannot end up in the bytes an agent caches.
|
|
56
|
+
*
|
|
57
|
+
* Reading order is the argument: what Spacefast is, talk to the user, exchange
|
|
58
|
+
* the link for a durable API key — the only expiring step, so it comes before
|
|
59
|
+
* client setup — then connect the client, then publish.
|
|
60
|
+
*/
|
|
61
|
+
export declare function renderAgentHandoffDocument(input: {
|
|
62
|
+
handoffOrigin: string;
|
|
63
|
+
mcpEndpoint: string;
|
|
64
|
+
targetId: AgentHandoffTarget;
|
|
65
|
+
}): string;
|
|
66
|
+
/**
|
|
67
|
+
* The document behind an anonymous (signed-out) handoff link. Same opening as
|
|
68
|
+
* the signed-in "any" document, ordered by usefulness: the two things the
|
|
69
|
+
* agent can actually do (publish with the no-account POST, or have the user
|
|
70
|
+
* sign in for a real handoff) come before the optional client catalog. The
|
|
71
|
+
* link itself grants nothing — its fetch only feeds the /start arrival watch —
|
|
72
|
+
* and the document doesn't narrate that; "Get a credential" states the one
|
|
73
|
+
* fact the agent needs.
|
|
74
|
+
*/
|
|
75
|
+
export declare function renderAnonymousAgentHandoffDocument(input: {
|
|
76
|
+
mcpEndpoint: string;
|
|
77
|
+
}): string;
|
|
63
78
|
/** Builds every copy-ready handoff artifact from one validated URL and target catalog row. */
|
|
64
79
|
export declare function buildAgentHandoff(input: {
|
|
65
80
|
expectedOrigin: string;
|
|
66
|
-
documentOrigin?: string;
|
|
67
81
|
mcpEndpoint: string;
|
|
68
82
|
targetId: ConnectTargetId;
|
|
69
83
|
url: string;
|
|
70
84
|
}): AgentHandoff;
|
|
85
|
+
/**
|
|
86
|
+
* The signed-out half: a handoff that carries no team, no Space, and no
|
|
87
|
+
* authority, so its document is the public setup guide. It exists only so the
|
|
88
|
+
* fetch is observable — /start can tell the visitor their agent arrived without
|
|
89
|
+
* first making them sign up.
|
|
90
|
+
*
|
|
91
|
+
* The handoff line is APPENDED to the caller's prompt rather than replacing it:
|
|
92
|
+
* signed out, the prompt is still the thing carrying the user's actual task.
|
|
93
|
+
* One gesture, one sentence, single-sourced so no surface can word it
|
|
94
|
+
* differently. With no task selected the handoff line IS the prompt — the
|
|
95
|
+
* fetched document carries the whole setup, so the copy stays a single link.
|
|
96
|
+
*/
|
|
97
|
+
export declare function buildAnonymousAgentHandoff(input: {
|
|
98
|
+
expectedOrigin: string;
|
|
99
|
+
url: string;
|
|
100
|
+
/** The caller's own prompt text. The handoff line goes after it. */
|
|
101
|
+
context: string;
|
|
102
|
+
}): AgentHandoff;
|
|
71
103
|
export declare function renderAgentSetupTemplate(value: string): string;
|
|
72
|
-
export declare function aiInstructionsText(): string;
|
|
73
104
|
export declare function agentSetupMarkdown(): string;
|