@sl-testing/ac-pulumi 0.1.29 → 0.1.31
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
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Infra Pulumi Provider
|
|
2
|
+
|
|
3
|
+
# Spec
|
|
4
|
+
- Export surface: `@sl-testing/ac-pulumi`.
|
|
5
|
+
- Purpose: own the custom Pulumi provider source, provider schema, generated Node SDK distribution, plugin packaging, and install-time plugin bootstrap.
|
|
6
|
+
- Owns: `core/infra-pulumi-provider/provider`, `core/infra-pulumi-provider/postinstall.js`, generated SDK artifacts under `dist`, provider schema/codegen inputs, and release packaging logic for the published Pulumi package.
|
|
7
|
+
- Does not own: Terraform env roots, platform API behavior, or product resource semantics beyond faithfully exposing the platform contract.
|
|
8
|
+
- Dependencies: resource semantics come from `core/api/AGENTS.md` and the owning domain module `AGENTS.md` files.
|
|
9
|
+
- Cross-module contract: consumers import provider resources only from the package root `@sl-testing/ac-pulumi`.
|
|
10
|
+
- Provider package contract:
|
|
11
|
+
- this module ships the `agentcloud` Pulumi resource provider plus the generated Node SDK published as `@sl-testing/ac-pulumi`
|
|
12
|
+
- provider source-of-truth lives in `provider/*.go`; checked-in `dist` output is generated, not hand-edited
|
|
13
|
+
- release packaging runs through `core/repo-tools/src/build-ac-pulumi-package.sh`, injects `main.providerVersion`, runs `pulumi package gen-sdk`, patches the generated Node wrapper, and bundles provider binaries plus `postinstall.js`
|
|
14
|
+
- published installs auto-attempt `pulumi plugin install resource agentcloud <version> --reinstall` from the packaged binary, but do not hard-fail npm install if Pulumi or the plugin install step is unavailable
|
|
15
|
+
- bundled plugin binaries currently target `darwin-arm64` and `linux-x64`
|
|
16
|
+
- Provider scope and config:
|
|
17
|
+
- the provider manages project-owned resources inside one existing project at a time
|
|
18
|
+
- provider config keys are `agentcloud:apiUrl` and `agentcloud:projectId`
|
|
19
|
+
- resource `projectId` may override provider config per resource; reads prefer explicit `projectId`, then the compound import ID, then provider config
|
|
20
|
+
- `agentcloud:apiUrl` may come from Pulumi config or `AC_API_URL`; `projectId` must come from Pulumi config or resource input, not an env fallback
|
|
21
|
+
- previews synthesize placeholder canonical IDs with zero suffixes until the API returns the real resource ID
|
|
22
|
+
- project-owned import IDs use `<projectId>/<resource_type>/<resource_id>`
|
|
23
|
+
- the provider does not use workspace-era identifiers in the product contract
|
|
24
|
+
- Provider connectivity and auth:
|
|
25
|
+
- `agentcloud infra init` persists `agentcloud:projectId` and `agentcloud:environment=prod`, but not `agentcloud:apiUrl`
|
|
26
|
+
- machine-side `agentcloud infra plan|apply|drift|destroy` uses the canonical remote Pulumi backend for the target stack
|
|
27
|
+
- `agentcloud infra apply` never implicitly reuses a default saved plan file; saved-plan apply happens only with `--plan-file`
|
|
28
|
+
- auth resolution order is `AC_BOOTSTRAP_TOKEN` exchange at `POST /v1/runtime-auth/exchange`, then `AC_TOKEN`, then `AC_TOKEN_FILE`, then `AC_SESSION_COOKIE`, then `AC_SESSION_FILE`, then `~/.agentcloud/session.cookie`
|
|
29
|
+
- `AC_TOKEN_FILE` is bearer-token-only and rejects cookie-form values
|
|
30
|
+
- `AC_SESSION_FILE` is cookie-only and rejects bearer-token-only values
|
|
31
|
+
- Provider surface:
|
|
32
|
+
- managed resources are `Secret`, `ProjectRole`, `ProjectRoleRule`, `ProjectRoleBinding`, `Database`, `Image`, `Machine`, `AgentConfiguration`, `Job`, `Service`, `ServiceDeploymentResource`, and `SlackConnection`
|
|
33
|
+
- invoke helpers are `permissionCatalog`, `agentRuns`, `messages`, `jobRuns`, `serviceDeployments`, `imageVersions`, `imageVersionsByImage`, and `logs`
|
|
34
|
+
- invoke helpers are project-scoped, read-only helpers; lifecycle ownership belongs to resources
|
|
35
|
+
- Resource lifecycle contract:
|
|
36
|
+
- `Secret`: `key` is immutable; update re-puts the value; reads never fetch plaintext back from the API and preserve the Pulumi-encrypted last-known value in state
|
|
37
|
+
- `ProjectRole`: `name` is immutable; update patches `description` only
|
|
38
|
+
- `ProjectRoleRule`: wraps role grants; `roleId` and `permission` are immutable; updates replace rule scope/resource selectors by deleting the old rule and granting a new one; validated rule selectors are limited to canonical product resource types
|
|
39
|
+
- `ProjectRoleBinding`: binds `subjectType + subjectId + roleId`; valid subject types are `user`, `agent_configuration`, `job`, `service`, and `public`; create de-duplicates by looking up an existing binding on conflict; updates are delete-and-recreate
|
|
40
|
+
- `Database`: create/read/delete only; `name` is immutable; state stays minimal with `projectId`, `name`, `databaseId`, and `status`; no restore, endpoint metadata, credentials metadata, cluster identifiers, AWS ARNs, or size classes are exposed
|
|
41
|
+
- `Image`: `name` and `sourceType` are immutable; updates patch `dockerfilePath`, `contextPath`, and `registryRef`; registry-source reads preserve explicit `registryRef` input when needed; delete retries deterministic `409` conflicts briefly before surfacing failure
|
|
42
|
+
- `Machine`: `name` is immutable; image version, size, and working directory update in place; reads treat `deleted` status as absent
|
|
43
|
+
- `AgentConfiguration`: this is the durable configuration object, not the runtime agent; `name` and `provider` are immutable; image version, size, working dir, model, Codex thinking, instructions, and idle timeouts update in place
|
|
44
|
+
- `Job`: `name` is immutable; image version, command, input schema, timeout, and max parallel runs update in place
|
|
45
|
+
- `Service`: `type` and `name` are immutable; `cpu`, `memoryMb`, `port`, and `healthcheckPath` update in place; reads expose live `status` and `serviceUrl`
|
|
46
|
+
- `ServiceDeploymentResource`: models service deploy operations, not the service definition; `projectId` and `serviceId` replace, `imageVersionId` replace, create/update call `POST /deploy` and wait up to 10 minutes for a `healthy` deployment, and a matching current healthy deployment is treated as idempotent success; delete is intentionally a no-op and does not rollback
|
|
47
|
+
- There is no standalone Pulumi `Function` resource. Function services expose manifest-backed functions from the deployed image and are managed through the `Service` plus `ServiceDeploymentResource` contract.
|
|
48
|
+
- Replace, import, and error semantics:
|
|
49
|
+
- default rule is dumb/simple mapping: safe scalar knobs update in place; ownership/identity fields replace
|
|
50
|
+
- canonical project-scoped import IDs exist for all managed resources; most resources can read/delete from the import ID alone, but `ProjectRoleRule` and `ProjectRoleBinding` currently still rely on state-carried IDs on follow-up read/delete
|
|
51
|
+
- surfaced provider errors preserve API `error_code`
|
|
52
|
+
- `400` maps to `InvalidArgument`
|
|
53
|
+
- `401` and `403` map to `PermissionDenied`
|
|
54
|
+
- `404` maps to `NotFound`
|
|
55
|
+
- `409` maps to `FailedPrecondition`
|
|
56
|
+
- delete treats `NotFound` as success for managed resources
|
|
57
|
+
- runtime agents are not Pulumi-managed resources
|
|
58
|
+
- Provider generality:
|
|
59
|
+
- the provider is product-level and project-agnostic
|
|
60
|
+
- it does not hardcode meta-project names, resource names, service names, or workflow assumptions
|
|
61
|
+
- it does not ship a `Project` resource and does not manage `projects.main_agent_configuration_id` or `projects.main_agent_id`
|
|
62
|
+
- project main-agent pointers remain API-managed or userland-managed
|
|
63
|
+
|
|
64
|
+
# Testing
|
|
65
|
+
- Fast proof: `npm run -w core/infra-pulumi-provider lint`.
|
|
66
|
+
- Provider proof: `(cd core/infra-pulumi-provider/provider && go test ./...)`.
|
|
67
|
+
- SDK proof: rerun `bash core/repo-tools/src/build-ac-pulumi-package.sh --version <version>` when schema/codegen, provider packaging, or plugin bootstrap changes.
|
|
68
|
+
- Install proof: run `bash core/repo-tools/src/smoke-ac-pulumi-npm-install.sh [--version <version>]` for the published package path.
|
|
69
|
+
|
|
70
|
+
# Deployment
|
|
71
|
+
- Ships as the published Pulumi provider and generated SDK package, not as a long-running runtime.
|
|
72
|
+
- Any provider contract change must be regenerated and republished before meta-project stacks consume it.
|
|
73
|
+
- Keep `package.json`, the Pulumi package metadata, and injected provider binary version aligned across release artifacts.
|
|
74
|
+
|
|
75
|
+
# Monitoring
|
|
76
|
+
- Watch provider apply/import failures, auth resolution regressions, schema drift, postinstall/plugin install regressions, and generated SDK mismatches against the live API.
|
|
77
|
+
- After release, validate at least one representative Pulumi program still previews and applies.
|
|
78
|
+
|
|
79
|
+
# Risks
|
|
80
|
+
- Provider drift breaks infrastructure reconciliation and meta-project deployment.
|
|
81
|
+
- Import/read drift is especially risky because Pulumi state adoption depends on canonical compound IDs working consistently.
|
|
82
|
+
- Never patch generated output without updating the underlying provider/schema pipeline.
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/agentcloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"main": "bin/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"pulumi": {
|
|
15
15
|
"resource": true,
|
|
16
16
|
"name": "agentcloud",
|
|
17
|
-
"version": "0.1.
|
|
17
|
+
"version": "0.1.31"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sl-testing/ac-pulumi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "AgentCloud TypeScript SDK generated from the Pulumi provider schema",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "echo 'no tests yet'"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@pulumi/pulumi": "
|
|
26
|
+
"@pulumi/pulumi": "3.158.0"
|
|
27
27
|
},
|
|
28
28
|
"agentcloud": {
|
|
29
29
|
"kind": "infra",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"pulumi": {
|
|
33
33
|
"resource": true,
|
|
34
34
|
"name": "agentcloud",
|
|
35
|
-
"version": "0.1.
|
|
35
|
+
"version": "0.1.31"
|
|
36
36
|
}
|
|
37
37
|
}
|