@phpsandbox/sdk 0.2.2 → 0.2.3

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 CHANGED
@@ -369,3 +369,33 @@ try {
369
369
  ## License
370
370
 
371
371
  MIT
372
+
373
+ ### Publishing without Helfer
374
+
375
+ Publishing is a platform capability. An API-key client can assign production settings with `notebook.secrets`, discover destinations and owned resources through `notebook.publication.catalog`, and submit its application choices through `prepareApplication`.
376
+
377
+ ```ts
378
+ const notebook = await client.notebook.get('SANDBOX_ID');
379
+ const review = await notebook.publication.prepareApplication({
380
+ schemaVersion: 1,
381
+ components: [{
382
+ id: 'web', kind: 'http-service', root: '.',
383
+ build: { mode: 'dockerfile', context: '.', dockerfile: { source: 'project', path: 'Dockerfile' } },
384
+ runtime: { kind: 'http', port: 3333, healthCheck: { path: '/' } },
385
+ placement: { provider: 'ssh-server', serverId: 'OWNED_SERVER_ID' },
386
+ }],
387
+ });
388
+ if (!review.review.ready) {
389
+ console.log(review.review.blockers);
390
+ } else {
391
+ // Present this exact review and obtain confirmation before executing.
392
+ const application = await notebook.publication.publishApplication({ reviewId: review.review.id });
393
+ const current = await notebook.publication.application(application.id);
394
+ console.log(current.status); // publishing, healthy, failed, or deleted
395
+ }
396
+ notebook.dispose();
397
+ ```
398
+
399
+ Core owns validation, source snapshots, review expiry, identity, resource ownership, execution and recovery. The confirmation reference binds the resolved review; another client does not copy source revisions or recreate provider logic. Repeated confirmation of an executed reference returns its existing application. A corrected review retains the publication and address. `retryApplication(id)` asks the platform to revalidate and retry failed components; inspect current state and logs when an outcome is uncertain. `destroyApplication(id)` unpublishes, and resource deletion requires the explicit `deleteResources` option.
400
+
401
+ Helfer presents choices, recommendations and explanations, and resumes its own conversation from platform outcomes. Its chat monitor does not own builds or publication state. The CLI exposes the same operations as `application plan`, `application publish`, `application status`, `application retry`, and `application delete`; JSON input is available for multi-component plans.
@@ -52,6 +52,13 @@ export interface PublicationReadiness {
52
52
  productionVariables: string[];
53
53
  missingVariables: string[];
54
54
  warnings: string[];
55
+ configuration?: PublicationConfigurationField[];
56
+ defaultBuild?: 'laravel' | 'dockerfile' | 'unresolved' | null;
57
+ }
58
+ export interface PublicationConfigurationField {
59
+ name: string;
60
+ requirement: 'required' | 'optional' | 'platform';
61
+ source: string;
55
62
  }
56
63
  export type PublicationResourceMode = 'none' | 'create' | 'reuse' | 'external' | 'enable';
57
64
  export interface PublicationResourceSelection {
@@ -257,11 +264,7 @@ export interface PublicationApplicationPlan extends PublicationApplicationPlanIn
257
264
  publicationId: string | null;
258
265
  destinations: Record<string, string | null>;
259
266
  productionVariables: string[];
260
- configuration: Array<{
261
- name: string;
262
- requirement: 'required' | 'optional' | 'platform';
263
- source: string;
264
- }>;
267
+ configuration: PublicationConfigurationField[];
265
268
  source: {
266
269
  type: 'workspace' | 'git';
267
270
  repository: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phpsandbox/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "The TypeScript SDK for PHPSandbox cloud development environments",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",