@vertesia/common 1.5.0-dev.20260717.131047Z → 1.5.0-dev.20260722.120446Z

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.
Files changed (110) hide show
  1. package/lib/apps.d.ts +144 -47
  2. package/lib/apps.d.ts.map +1 -1
  3. package/lib/apps.js +21 -9
  4. package/lib/apps.js.map +1 -1
  5. package/lib/audit-trail.d.ts +61 -1
  6. package/lib/audit-trail.d.ts.map +1 -1
  7. package/lib/audit-trail.js +15 -0
  8. package/lib/audit-trail.js.map +1 -1
  9. package/lib/index.d.ts +7 -0
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -0
  12. package/lib/index.js.map +1 -1
  13. package/lib/interaction.d.ts +4 -0
  14. package/lib/interaction.d.ts.map +1 -1
  15. package/lib/interaction.js.map +1 -1
  16. package/lib/platform-event.d.ts +37 -3
  17. package/lib/platform-event.d.ts.map +1 -1
  18. package/lib/platform-event.js.map +1 -1
  19. package/lib/project.d.ts +119 -20
  20. package/lib/project.d.ts.map +1 -1
  21. package/lib/project.js +65 -0
  22. package/lib/project.js.map +1 -1
  23. package/lib/query.d.ts +6 -0
  24. package/lib/query.d.ts.map +1 -1
  25. package/lib/refs.d.ts +1 -0
  26. package/lib/refs.d.ts.map +1 -1
  27. package/lib/schema-for-extraction.d.ts +21 -0
  28. package/lib/schema-for-extraction.d.ts.map +1 -0
  29. package/lib/schema-for-extraction.js +205 -0
  30. package/lib/schema-for-extraction.js.map +1 -0
  31. package/lib/store/conversation-state.d.ts +1 -1
  32. package/lib/store/doc-analyzer.d.ts +10 -67
  33. package/lib/store/doc-analyzer.d.ts.map +1 -1
  34. package/lib/store/dsl-workflow.d.ts +1 -0
  35. package/lib/store/dsl-workflow.d.ts.map +1 -1
  36. package/lib/store/dsl-workflow.js.map +1 -1
  37. package/lib/store/grounded-extraction.d.ts +146 -0
  38. package/lib/store/grounded-extraction.d.ts.map +1 -0
  39. package/lib/store/grounded-extraction.js +8 -0
  40. package/lib/store/grounded-extraction.js.map +1 -0
  41. package/lib/store/index.d.ts +1 -0
  42. package/lib/store/index.d.ts.map +1 -1
  43. package/lib/store/index.js +1 -0
  44. package/lib/store/index.js.map +1 -1
  45. package/lib/store/store.d.ts +307 -1
  46. package/lib/store/store.d.ts.map +1 -1
  47. package/lib/store/store.js +438 -0
  48. package/lib/store/store.js.map +1 -1
  49. package/lib/store/workflow.d.ts +3 -0
  50. package/lib/store/workflow.d.ts.map +1 -1
  51. package/lib/store/workflow.js.map +1 -1
  52. package/lib/user.d.ts +14 -0
  53. package/lib/user.d.ts.map +1 -1
  54. package/lib/user.js +31 -0
  55. package/lib/user.js.map +1 -1
  56. package/lib/vertesia-common.js +2 -2
  57. package/lib/vertesia-common.js.map +1 -1
  58. package/lib/view-configuration-validation.d.ts +15 -0
  59. package/lib/view-configuration-validation.d.ts.map +1 -0
  60. package/lib/view-configuration-validation.js +63 -0
  61. package/lib/view-configuration-validation.js.map +1 -0
  62. package/lib/view-query-validation.d.ts +13 -0
  63. package/lib/view-query-validation.d.ts.map +1 -0
  64. package/lib/view-query-validation.js +266 -0
  65. package/lib/view-query-validation.js.map +1 -0
  66. package/lib/view-validation-helpers.d.ts +15 -0
  67. package/lib/view-validation-helpers.d.ts.map +1 -0
  68. package/lib/view-validation-helpers.js +25 -0
  69. package/lib/view-validation-helpers.js.map +1 -0
  70. package/lib/views-schema.d.ts +1992 -0
  71. package/lib/views-schema.d.ts.map +1 -0
  72. package/lib/views-schema.js +674 -0
  73. package/lib/views-schema.js.map +1 -0
  74. package/lib/views-validation.d.ts +21 -0
  75. package/lib/views-validation.d.ts.map +1 -0
  76. package/lib/views-validation.js +164 -0
  77. package/lib/views-validation.js.map +1 -0
  78. package/lib/views.d.ts +381 -0
  79. package/lib/views.d.ts.map +1 -0
  80. package/lib/views.js +41 -0
  81. package/lib/views.js.map +1 -0
  82. package/package.json +5 -5
  83. package/src/apps.test.ts +9 -1
  84. package/src/apps.ts +171 -73
  85. package/src/audit-trail.ts +83 -0
  86. package/src/index.ts +12 -0
  87. package/src/interaction.ts +4 -0
  88. package/src/platform-event.ts +39 -2
  89. package/src/project.test.ts +44 -0
  90. package/src/project.ts +205 -22
  91. package/src/query.ts +6 -0
  92. package/src/refs.ts +1 -0
  93. package/src/schema-for-extraction.test.ts +191 -0
  94. package/src/schema-for-extraction.ts +231 -0
  95. package/src/store/conversation-state.ts +1 -1
  96. package/src/store/doc-analyzer.ts +10 -76
  97. package/src/store/dsl-workflow.ts +1 -0
  98. package/src/store/grounded-extraction.ts +154 -0
  99. package/src/store/index.ts +1 -0
  100. package/src/store/store.ts +778 -1
  101. package/src/store/workflow.ts +3 -0
  102. package/src/user.ts +46 -0
  103. package/src/view-configuration-validation.ts +74 -0
  104. package/src/view-query-validation.test.ts +21 -0
  105. package/src/view-query-validation.ts +319 -0
  106. package/src/view-validation-helpers.ts +28 -0
  107. package/src/views-schema.test.ts +364 -0
  108. package/src/views-schema.ts +689 -0
  109. package/src/views-validation.ts +234 -0
  110. package/src/views.ts +484 -0
package/lib/views.js ADDED
@@ -0,0 +1,41 @@
1
+ export const VIEW_EXPERIENCE_SCHEMA_VERSION = 1;
2
+ /** Build the generic reusable client route for a persisted or app-contributed View. */
3
+ export function viewExperienceRoute(id) {
4
+ return `/view/${encodeURIComponent(id)}`;
5
+ }
6
+ export const VIEW_SEARCH_FIELD_TYPES = ['text', 'keyword', 'number', 'date', 'boolean'];
7
+ export const VIEW_RESULT_FIELD_FORMATS = [
8
+ 'text',
9
+ 'date',
10
+ 'number',
11
+ 'badge',
12
+ 'user',
13
+ 'content_type',
14
+ 'location',
15
+ ];
16
+ /**
17
+ * Project a persisted or extended View value back to its reusable configuration
18
+ * fields. Callers that require a persisted configuration must validate the
19
+ * result at their API or persistence boundary because legacy records may not
20
+ * satisfy newer persisted-only requirements.
21
+ */
22
+ export function getViewExperienceConfiguration(value) {
23
+ return {
24
+ name: value.name,
25
+ ...(value.description === undefined ? {} : { description: value.description }),
26
+ ...(value.enabled === undefined ? {} : { enabled: value.enabled }),
27
+ ...(value.layout === undefined ? {} : { layout: value.layout }),
28
+ ...(value.scope === undefined ? {} : { scope: value.scope }),
29
+ ...(value.navigation === undefined ? {} : { navigation: value.navigation }),
30
+ ...(value.search === undefined ? {} : { search: value.search }),
31
+ ...(value.results === undefined ? {} : { results: value.results }),
32
+ };
33
+ }
34
+ /** Project a type-valid persisted View while preserving its required documentation field. */
35
+ export function getPersistedViewExperienceConfiguration(value) {
36
+ return {
37
+ ...getViewExperienceConfiguration(value),
38
+ description: value.description,
39
+ };
40
+ }
41
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAU,CAAC;AAIzD,uFAAuF;AACvF,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC1C,OAAO,SAAS,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7C,CAAC;AAkGD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAqDjG,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,cAAc;IACd,UAAU;CACJ,CAAC;AAwHX;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,KAAkC;IAC7E,OAAO;QACH,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9E,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClE,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC/D,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5D,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC3E,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC/D,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;KACrE,CAAC;AACN,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,uCAAuC,CACnD,KAA2C;IAE3C,OAAO;QACH,GAAG,8BAA8B,CAAC,KAAK,CAAC;QACxC,WAAW,EAAE,KAAK,CAAC,WAAW;KACjC,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/common",
3
- "version": "1.5.0-dev.20260717.131047Z",
3
+ "version": "1.5.0-dev.20260722.120446Z",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -17,14 +17,14 @@
17
17
  }
18
18
  },
19
19
  "devDependencies": {
20
- "rolldown": "1.1.4",
20
+ "rolldown": "1.1.5",
21
21
  "typescript": "^6.0.3",
22
- "vitest": "^4.1.9",
22
+ "vitest": "^4.1.10",
23
23
  "@vertesia/tsconfig": "0.1.0"
24
24
  },
25
25
  "dependencies": {
26
26
  "ajv": "^8.20.0",
27
- "@llumiverse/common": "1.5.0-dev.20260713.114357Z"
27
+ "@llumiverse/common": "1.5.0-dev.20260722.112223Z"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "ai",
40
40
  "typescript"
41
41
  ],
42
- "gitHead": "8aaad228827b2927db8e6aa75b27bfac90fec36f",
42
+ "gitHead": "203c30e5a8ddc583ac9f1acce0f5445eb38a9551",
43
43
  "scripts": {
44
44
  "lint": "biome lint src",
45
45
  "test": "vitest run",
package/src/apps.test.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { effectiveAppAccessControl } from './apps.js';
2
+ import { APP_ARTIFACT_TYPES, APP_CAPABILITIES, APP_PACKAGE_SCOPES, effectiveAppAccessControl } from './apps.js';
3
+
4
+ describe('app capability contracts', () => {
5
+ it('keeps views in manifest, package, and build-artifact contracts', () => {
6
+ expect(APP_CAPABILITIES).toContain('views');
7
+ expect(APP_PACKAGE_SCOPES).toContain('views');
8
+ expect(APP_ARTIFACT_TYPES).toContain('view');
9
+ });
10
+ });
3
11
 
4
12
  describe('effectiveAppAccessControl', () => {
5
13
  it("returns 'all' when neither installation nor manifest set the field", () => {
package/src/apps.ts CHANGED
@@ -2,6 +2,7 @@ import type { JSONObject, JSONSchema, ToolDefinition } from '@llumiverse/common'
2
2
  import type { AppDashboardDefinition } from './data-platform.js';
3
3
  import type { CatalogInteractionRef } from './interaction.js';
4
4
  import type { DSLActivityOptions, InCodeProcessDefinition, InCodeTypeDefinition } from './store/index.js';
5
+ import type { InCodeViewDefinition } from './views.js';
5
6
 
6
7
  /** Allowed values for AppUINavItem.preferredSection */
7
8
  export const PREFERRED_SECTIONS = ['default', 'footer', 'settings'] as const;
@@ -383,27 +384,26 @@ export interface RemoteActivityDefinition {
383
384
  options?: DSLActivityOptions;
384
385
  }
385
386
 
386
- export type AppCapabilities = 'ui' | 'tools' | 'interactions' | 'types' | 'processes' | 'templates' | 'dashboards';
387
-
388
387
  /**
389
- * Canonical runtime list of {@link AppCapabilities} — the app capabilities Studio
390
- * renders/supports. Co-located with the type so TypeScript rejects any drift between
391
- * the two. Consumers (publish manifest derivation, etc.) must use this rather than
392
- * re-listing the values.
388
+ * Canonical app capabilities Studio renders/supports. The public type is derived from
389
+ * this list so runtime validation and TypeScript cannot drift.
393
390
  */
394
- export const APP_CAPABILITIES: readonly AppCapabilities[] = [
391
+ export const APP_CAPABILITIES = [
395
392
  'ui',
396
393
  'tools',
397
394
  'interactions',
398
395
  'types',
399
396
  'processes',
397
+ 'views',
400
398
  'templates',
401
399
  'dashboards',
402
- ];
400
+ ] as const;
401
+
402
+ export type AppCapabilities = (typeof APP_CAPABILITIES)[number];
403
403
 
404
404
  /**
405
405
  * Header carrying the app version a generated-app UI is running, so studio/zeno resolve app-owned
406
- * capability refs (`app:<app>:...`) against that version (candidate testing) instead of current.
406
+ * capability refs (`app:<app>:...`) against that exact version instead of the promoted version.
407
407
  * Resolution-time only; never persisted. Set by the generated app template via client.withAppVersion.
408
408
  */
409
409
  export const APP_VERSION_HEADER = 'x-vertesia-app-version';
@@ -414,26 +414,19 @@ export const APP_VERSION_HEADER = 'x-vertesia-app-version';
414
414
  * {@link AppCapabilities} folds together. Used by the App Solution Architect manifest and
415
415
  * the publish-time capability gate.
416
416
  */
417
- export type AppArtifactType =
418
- | 'interaction'
419
- | 'agent'
420
- | 'type'
421
- | 'process'
422
- | 'template'
423
- | 'dashboard'
424
- | 'activity'
425
- | 'tool';
426
-
427
- export const APP_ARTIFACT_TYPES: readonly AppArtifactType[] = [
417
+ export const APP_ARTIFACT_TYPES = [
428
418
  'interaction',
429
419
  'agent',
430
420
  'type',
431
421
  'process',
422
+ 'view',
432
423
  'template',
433
424
  'dashboard',
434
425
  'activity',
435
426
  'tool',
436
- ];
427
+ ] as const;
428
+
429
+ export type AppArtifactType = (typeof APP_ARTIFACT_TYPES)[number];
437
430
 
438
431
  /**
439
432
  * A single platform artifact the App Solution Architect requires the build to create.
@@ -473,8 +466,8 @@ export interface AppPlannedArtifact {
473
466
  /**
474
467
  * Structured result the App Solution Architect emits alongside its prose artifacts — the
475
468
  * machine-readable contract for the build. The implementation MUST create and successfully
476
- * exercise every required artifact before preview/publish. Persisted into the app repo as
477
- * {@link APP_CAPABILITY_MANIFEST_PATH} so it survives across runs and the publish-time
469
+ * exercise every required artifact before building a deployable version. Persisted into the app repo as
470
+ * {@link APP_CAPABILITY_MANIFEST_PATH} so it survives across runs and the version-build
478
471
  * capability gate can verify against it deterministically. If the builder finds the plan
479
472
  * wrong or insufficient, the orchestrator relaunches the architect to revise the manifest;
480
473
  * the gate always checks against the latest committed copy.
@@ -499,16 +492,14 @@ export interface AppCapabilityManifest {
499
492
  notes?: string;
500
493
  }
501
494
 
502
- /** Repo-relative path the capability manifest is committed to, read by the publish gate. */
495
+ /** Repo-relative path the capability manifest is committed to, read by version-build gates. */
503
496
  export const APP_CAPABILITY_MANIFEST_PATH = 'docs/app-capability-manifest.json';
504
-
505
497
  export type AppAvailableIn = 'app_portal' | 'composite_app';
506
498
 
507
- export type AppVersionKind = 'design' | 'preview' | 'published';
499
+ export type AppVersionKind = 'design' | 'version';
508
500
  export type AppVersionState = 'ready' | 'failed' | 'expired';
509
501
  export type AppVersionTarget = 'static' | 'service';
510
502
  export type AppVersionGitRefType = 'branch' | 'tag' | 'commit' | 'detached';
511
- export type AppBuildIntent = 'preview' | 'publish';
512
503
  export type AppBuildTrigger = 'ui' | 'git_push' | 'agent' | 'api';
513
504
 
514
505
  export interface AppVersionStorage {
@@ -527,8 +518,8 @@ export interface AppVersionGitSource {
527
518
  url?: string;
528
519
  remote?: string;
529
520
  /**
530
- * The source ref that should be used to reproduce this version. For immutable
531
- * app versions this is normally the tag created during preview/publish.
521
+ * The source ref that should be used to reproduce this version. Immutable
522
+ * app versions use the exact commit SHA rather than a mutable branch or tag.
532
523
  */
533
524
  ref?: string;
534
525
  ref_type?: AppVersionGitRefType;
@@ -558,13 +549,19 @@ export interface AppVersionRecord {
558
549
  version_id: string;
559
550
  kind: AppVersionKind;
560
551
  state: AppVersionState;
561
- active?: boolean;
552
+ promoted?: boolean;
562
553
  target?: AppVersionTarget;
563
554
  agent_run_id?: string;
555
+ /** Temporal workflow that produced this version. */
556
+ build_workflow_id?: string;
557
+ /** Temporal run that produced this version. */
558
+ build_workflow_run_id?: string;
564
559
  sandbox_id?: string;
565
560
  title?: string;
566
561
  description?: string;
567
562
  storage?: AppVersionStorage;
563
+ /** Exact Git commit used to build this immutable version. */
564
+ source_commit?: string;
568
565
  urls?: AppVersionUrls;
569
566
  manifest?: Record<string, unknown>;
570
567
  files?: string[];
@@ -575,25 +572,39 @@ export interface AppVersionRecord {
575
572
  created_by?: string;
576
573
  created_at: string;
577
574
  updated_at: string;
578
- published_at?: string;
575
+ built_at?: string;
579
576
  checked_at?: string;
580
577
  expires_at?: string;
581
578
  }
582
579
 
580
+ export interface DeleteAppVersionResponse {
581
+ id: string;
582
+ app_id: string;
583
+ version_id: string;
584
+ storage_prefix?: string;
585
+ deleted: boolean;
586
+ warnings: string[];
587
+ }
588
+
583
589
  export interface UpsertAppVersionRequest {
590
+ /** Existing version record to update in place, used by reproducible rebuilds. */
591
+ record_id?: string;
584
592
  app?: string;
585
593
  app_id: string;
586
594
  app_name?: string;
587
595
  version_id: string;
588
596
  kind: AppVersionKind;
589
597
  state?: AppVersionState;
590
- active?: boolean;
591
598
  target?: AppVersionTarget;
592
599
  agent_run_id?: string;
600
+ build_workflow_id?: string;
601
+ build_workflow_run_id?: string;
593
602
  sandbox_id?: string;
594
603
  title?: string;
595
604
  description?: string;
596
605
  storage?: AppVersionStorage;
606
+ /** Exact Git commit used to build this immutable version. */
607
+ source_commit?: string;
597
608
  urls?: AppVersionUrls;
598
609
  manifest?: Record<string, unknown>;
599
610
  files?: string[];
@@ -601,7 +612,7 @@ export interface UpsertAppVersionRequest {
601
612
  source_file_count?: number;
602
613
  screenshot_artifact?: string;
603
614
  checks?: string[];
604
- published_at?: string;
615
+ built_at?: string;
605
616
  checked_at?: string;
606
617
  expires_at?: string;
607
618
  }
@@ -613,7 +624,7 @@ export interface AppVersionListQuery {
613
624
  limit?: number;
614
625
  }
615
626
 
616
- export interface ActivateAppVersionResponse {
627
+ export interface PromoteAppVersionResponse {
617
628
  version: AppVersionRecord;
618
629
  app?: AppManifest;
619
630
  }
@@ -621,15 +632,12 @@ export interface ActivateAppVersionResponse {
621
632
  export interface StartAppBuildRequest {
622
633
  /**
623
634
  * Source branch, tag, or commit to build. When omitted, the app source
624
- * configuration chooses the dev branch for previews and production branch
625
- * for publishes.
635
+ * configuration chooses its default branch.
626
636
  */
627
637
  source_ref?: string;
628
638
  source_ref_type?: Extract<AppVersionGitRefType, 'branch' | 'tag' | 'commit'>;
629
- intent?: AppBuildIntent;
630
639
  trigger?: AppBuildTrigger;
631
640
  target?: AppVersionTarget;
632
- activate?: boolean;
633
641
  title?: string;
634
642
  description?: string;
635
643
  }
@@ -638,7 +646,8 @@ export interface StartAppBuildResponse {
638
646
  workflow_id: string;
639
647
  run_id: string;
640
648
  app_id: string;
641
- intent: AppBuildIntent;
649
+ version_id?: string;
650
+ rebuild_version_record_id?: string;
642
651
  source_ref?: string;
643
652
  source_ref_type?: Extract<AppVersionGitRefType, 'branch' | 'tag' | 'commit'>;
644
653
  }
@@ -646,6 +655,8 @@ export interface StartAppBuildResponse {
646
655
  export interface AppBuildWorkflowInput extends StartAppBuildRequest {
647
656
  app_id: string;
648
657
  app_record_id?: string;
658
+ /** Rebuild this persisted version record at its original commit and target. */
659
+ rebuild_version_record_id?: string;
649
660
  app_title?: string;
650
661
  app_description?: string;
651
662
  source_git_url?: string;
@@ -654,8 +665,9 @@ export interface AppBuildWorkflowInput extends StartAppBuildRequest {
654
665
  export interface AppBuildWorkflowResult {
655
666
  app_id: string;
656
667
  version_id: string;
657
- kind: Extract<AppVersionKind, 'preview' | 'published'>;
668
+ kind: Extract<AppVersionKind, 'version'>;
658
669
  state: AppVersionState;
670
+ source_commit: string;
659
671
  source_git?: AppVersionGitSource;
660
672
  urls?: AppVersionUrls;
661
673
  file_count?: number;
@@ -668,7 +680,6 @@ export interface AppBuildProgress {
668
680
  step: string;
669
681
  app_id?: string;
670
682
  version_id?: string;
671
- intent?: AppBuildIntent;
672
683
  source_ref?: string;
673
684
  source_ref_type?: Extract<AppVersionGitRefType, 'branch' | 'tag' | 'commit'>;
674
685
  source_commit?: string;
@@ -678,6 +689,66 @@ export interface AppBuildProgress {
678
689
  updated_at: string;
679
690
  }
680
691
 
692
+ export type AppScaffoldModule = 'service' | 'assistant' | 'content-app' | 'examples';
693
+
694
+ export interface StartAppScaffoldRequest {
695
+ /**
696
+ * App id / package name to create. It is normalized to the same slug rules
697
+ * used by @vertesia/create-plugin.
698
+ */
699
+ app_id: string;
700
+ title?: string;
701
+ description?: string;
702
+ modules?: AppScaffoldModule[];
703
+ /**
704
+ * Start an initial app version build after the source has been pushed.
705
+ * Defaults to true.
706
+ */
707
+ create_version?: boolean;
708
+ }
709
+
710
+ export interface StartAppScaffoldResponse {
711
+ workflow_id: string;
712
+ run_id: string;
713
+ app_id: string;
714
+ app_record_id?: string;
715
+ git_url?: string;
716
+ create_version: boolean;
717
+ }
718
+
719
+ export interface AppScaffoldWorkflowInput extends StartAppScaffoldRequest {}
720
+
721
+ export interface AppScaffoldWorkflowResult {
722
+ app_id: string;
723
+ app_record_id?: string;
724
+ git_url?: string;
725
+ source_git?: AppVersionGitSource;
726
+ files?: number;
727
+ initial_version_build?: StartAppBuildResponse;
728
+ }
729
+
730
+ export type AppScaffoldProgressStatus =
731
+ | 'queued'
732
+ | 'reserving'
733
+ | 'scaffolding'
734
+ | 'pushing'
735
+ | 'building'
736
+ | 'completed'
737
+ | 'failed';
738
+
739
+ export interface AppScaffoldProgress {
740
+ status: AppScaffoldProgressStatus;
741
+ step: string;
742
+ app_id?: string;
743
+ app_record_id?: string;
744
+ git_url?: string;
745
+ files?: number;
746
+ initial_version_build?: StartAppBuildResponse;
747
+ error?: string;
748
+ error_details?: string[];
749
+ updated_at: string;
750
+ }
751
+
681
752
  /**
682
753
  * Access control policy for an app installation.
683
754
  * Declares which access surfaces are gated by per-user ACEs.
@@ -832,8 +903,9 @@ export interface AppManifestData {
832
903
 
833
904
  /**
834
905
  * Source repository configuration for apps generated and maintained through
835
- * AppGen. Branches are mutable deployment lanes; immutable app versions
836
- * record their exact source tag/commit in AppVersionRecord.storage.source_git.
906
+ * AppGen. Branches are mutable development lanes; immutable app versions
907
+ * record their exact source commit in AppVersionRecord.source_commit and
908
+ * AppVersionRecord.storage.source_git.
837
909
  */
838
910
  source?: AppSourceConfig;
839
911
 
@@ -881,7 +953,7 @@ export interface Endpoints {
881
953
  ui?: string;
882
954
  /** The Smart HTTP app source git server base URL */
883
955
  git?: string;
884
- /** The appgen app-gateway base URL (serves published app bundles + their `/api` runtime). */
956
+ /** The appgen app-gateway base URL (serves promoted app bundles + their `/api` runtime). */
885
957
  gateway?: string;
886
958
  }
887
959
 
@@ -927,14 +999,46 @@ export interface AppRepoTree {
927
999
  entries: AppRepoTreeEntry[];
928
1000
  }
929
1001
 
930
- /** The content of a single file read from an app git repo at a given ref. */
931
- export interface AppRepoFile {
932
- /** Path relative to the repo root. */
933
- path: string;
934
- /** The ref the file was read at (empty/undefined = default branch / HEAD). */
1002
+ /** Browser-side limits mirrored by the app Git service document endpoint. */
1003
+ export const APP_REPO_DOCUMENT_UPLOAD_MAX_FILE_BYTES = 20 * 1024 * 1024;
1004
+ export const APP_REPO_DOCUMENT_UPLOAD_MAX_TOTAL_BYTES = 80 * 1024 * 1024;
1005
+ export const APP_REPO_DOCUMENT_UPLOAD_MAX_FILES = 20;
1006
+ export const APP_REPO_DOCUMENT_UPLOAD_PREFIX = 'docs/';
1007
+
1008
+ /** Result of committing one or more uploaded documents to an app repository. */
1009
+ export interface AppRepoDocumentCommit {
1010
+ /** Updated branch name. */
1011
+ ref: string;
1012
+ /** Branch HEAD before the commit. */
1013
+ previous_commit: string;
1014
+ /** Newly created commit SHA. */
1015
+ commit: string;
1016
+ /** Repository paths changed by the commit. */
1017
+ paths: string[];
1018
+ }
1019
+
1020
+ /** One commit that inserted or changed a file in an app git repository. */
1021
+ export interface AppRepoCommit {
1022
+ /** Full commit SHA. */
1023
+ commit: string;
1024
+ /** Complete commit message. */
1025
+ message: string;
1026
+ /** Commit author name, when available. */
1027
+ author?: string;
1028
+ /** Commit author date as an ISO-8601 string, when available. */
1029
+ date?: string;
1030
+ }
1031
+
1032
+ /** Commit history in an app git repository, optionally filtered to a file. */
1033
+ export interface AppRepoCommits {
1034
+ /** Ref from which history traversal started (empty/undefined = default branch / HEAD). */
935
1035
  ref?: string;
936
- /** UTF-8 file content. */
937
- content: string;
1036
+ /** File path relative to the repository root, when history was filtered to a file. */
1037
+ path?: string;
1038
+ /** Commits ordered newest first. */
1039
+ commits: AppRepoCommit[];
1040
+ /** Pass this cursor to retrieve the next page. Absent when history is exhausted. */
1041
+ next_cursor?: string;
938
1042
  }
939
1043
 
940
1044
  /** A branch or tag in an app git repo, resolved to its latest commit. */
@@ -959,37 +1063,26 @@ export interface AppRepoRefs {
959
1063
  tags: AppRepoRef[];
960
1064
  }
961
1065
 
962
- export type AppPackageScope =
963
- | 'ui'
964
- | 'tools'
965
- | 'interactions'
966
- | 'types'
967
- | 'processes'
968
- | 'templates'
969
- | 'dashboards'
970
- | 'settings'
971
- | 'widgets'
972
- | 'activities'
973
- | 'all';
974
-
975
1066
  /**
976
- * Canonical runtime list of {@link AppPackageScope} — every package scope, including the
977
- * catch-all `'all'`. Co-located with the type so TypeScript rejects drift. Consumers (the
978
- * /package?scope= parser, the inspection report) must use this rather than re-listing.
1067
+ * Canonical package scopes, including the catch-all `all`. The public type is derived
1068
+ * from this list so request parsing and TypeScript cannot drift.
979
1069
  */
980
- export const APP_PACKAGE_SCOPES: readonly AppPackageScope[] = [
1070
+ export const APP_PACKAGE_SCOPES = [
981
1071
  'ui',
982
1072
  'tools',
983
1073
  'interactions',
984
1074
  'types',
985
1075
  'processes',
1076
+ 'views',
986
1077
  'templates',
987
1078
  'dashboards',
988
1079
  'settings',
989
1080
  'widgets',
990
1081
  'activities',
991
1082
  'all',
992
- ];
1083
+ ] as const;
1084
+
1085
+ export type AppPackageScope = (typeof APP_PACKAGE_SCOPES)[number];
993
1086
  export interface AppPackage {
994
1087
  /**
995
1088
  * The UI configuration of the app
@@ -1024,6 +1117,11 @@ export interface AppPackage {
1024
1117
  */
1025
1118
  processes?: InCodeProcessDefinition[];
1026
1119
 
1120
+ /**
1121
+ * View Experiences exposed by the app as in-code definitions.
1122
+ */
1123
+ views?: InCodeViewDefinition[];
1124
+
1027
1125
  /**
1028
1126
  * Templates provided by the app.
1029
1127
  */
@@ -1066,14 +1164,14 @@ export interface AppInspectionIssue {
1066
1164
  }
1067
1165
 
1068
1166
  /**
1069
- * Per-capability report of what an app's published package actually exposes,
1167
+ * Per-capability report of what an app's promoted package actually exposes,
1070
1168
  * compared against what its manifest declares.
1071
1169
  */
1072
1170
  export interface AppInspectionCapabilityReport {
1073
1171
  capability: AppPackageScope;
1074
1172
  /** True when the manifest's `capabilities` array declares this capability. */
1075
1173
  declared: boolean;
1076
- /** The local ids the published package actually serves for this capability. */
1174
+ /** The local ids the promoted package actually serves for this capability. */
1077
1175
  exposed_ids: string[];
1078
1176
  /** Convenience count of `exposed_ids`. */
1079
1177
  exposed_count: number;
@@ -1081,7 +1179,7 @@ export interface AppInspectionCapabilityReport {
1081
1179
 
1082
1180
  /**
1083
1181
  * Result of inspecting an app's registration: the resolved manifest state, what
1084
- * the published package actually exposes per capability, and diagnostics. This
1182
+ * the promoted package actually exposes per capability, and diagnostics. This
1085
1183
  * is the ground truth used by the `app_inspect_registration` agent tool and the
1086
1184
  * Build › App inspection UI to verify what is registered vs declared, instead of
1087
1185
  * inferring it from failed object/import calls.
@@ -1099,7 +1197,7 @@ export interface AppInspectionResult {
1099
1197
  access_control?: string;
1100
1198
  /** The capabilities declared on the manifest. */
1101
1199
  capabilities: AppPackageScope[];
1102
- /** What the published package exposes, per capability. */
1200
+ /** What the promoted package exposes, per capability. */
1103
1201
  package: AppInspectionCapabilityReport[];
1104
1202
  /** Diagnostics — errors and warnings about the registration state. */
1105
1203
  issues: AppInspectionIssue[];
@@ -19,6 +19,8 @@ export const AUDIT_ACTIONS = [
19
19
  'inference',
20
20
  'embedding',
21
21
  'image_generation',
22
+ // Content processing outcomes
23
+ 'document_processed',
22
24
  ] as const;
23
25
 
24
26
  export type KnownAuditAction = (typeof AUDIT_ACTIONS)[number];
@@ -113,3 +115,84 @@ export interface AuditTrailResponse {
113
115
  limit: number;
114
116
  offset: number;
115
117
  }
118
+
119
+ export const AUDIT_AGGREGATION_DIMENSIONS = [
120
+ 'time',
121
+ 'action',
122
+ 'resource_type',
123
+ 'event_category',
124
+ 'provider',
125
+ 'project_id',
126
+ 'details.pipeline',
127
+ 'details.verdict',
128
+ 'details.workflow_type',
129
+ 'details.rule_id',
130
+ 'model',
131
+ ] as const;
132
+
133
+ export type AuditAggregationDimension = (typeof AUDIT_AGGREGATION_DIMENSIONS)[number];
134
+ export type AuditAggregationResolution = 'hour' | 'day' | 'week' | 'month';
135
+ export type AuditAggregationDetailField = 'pipeline' | 'verdict' | 'workflow_type' | 'rule_id';
136
+ export type AuditAggregationOperation = 'count' | 'count_distinct' | 'sum_meter' | 'average_meter';
137
+ export type AuditAggregationDistinctField = 'resource_id' | 'request_id';
138
+
139
+ export interface AuditAggregationGroup {
140
+ dimension: AuditAggregationDimension;
141
+ /** Required for the time dimension; defaults to day. */
142
+ resolution?: AuditAggregationResolution;
143
+ }
144
+
145
+ export interface AuditAggregationMetric {
146
+ /** Stable key used in response rows. Must contain only letters, numbers, underscores, or hyphens. */
147
+ id: string;
148
+ operation: AuditAggregationOperation;
149
+ /** Required for count_distinct. */
150
+ field?: AuditAggregationDistinctField;
151
+ /** Required for meter operations. */
152
+ meterCategory?: string;
153
+ /** Required for meter operations. */
154
+ meterType?: string;
155
+ }
156
+
157
+ export interface AuditAggregationDetailFilter {
158
+ field: AuditAggregationDetailField;
159
+ values: string[];
160
+ }
161
+
162
+ export interface AuditAggregationFilter {
163
+ actions?: AuditAction[];
164
+ resourceTypes?: string[];
165
+ eventCategories?: EventCategory[];
166
+ providers?: string[];
167
+ success?: boolean;
168
+ details?: AuditAggregationDetailFilter[];
169
+ }
170
+
171
+ /**
172
+ * Safe audit aggregation query. The server always applies the authenticated account scope and,
173
+ * for project-scoped principals, replaces projectId with the authenticated project.
174
+ */
175
+ export interface AuditAggregationQuery {
176
+ /** Optional account-admin project filter. Ignored for project-scoped principals. */
177
+ projectId?: string;
178
+ /** Start time; defaults to 30 days before to. The server caps the range at 366 days. */
179
+ from?: string;
180
+ /** End time; defaults to the current time. */
181
+ to?: string;
182
+ filter?: AuditAggregationFilter;
183
+ groupBy?: AuditAggregationGroup[];
184
+ metrics: AuditAggregationMetric[];
185
+ /** Maximum groups returned (default 50, max 200). */
186
+ limit?: number;
187
+ }
188
+
189
+ export interface AuditAggregationRow {
190
+ dimensions: Partial<Record<AuditAggregationDimension, string | null>>;
191
+ metrics: Record<string, number>;
192
+ }
193
+
194
+ export interface AuditAggregationResponse {
195
+ rows: AuditAggregationRow[];
196
+ from: string;
197
+ to: string;
198
+ }