@autohq/cli 0.1.124 → 0.1.125

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.
@@ -21623,8 +21623,11 @@ var SessionIdentitySchema = external_exports.object({
21623
21623
  }).strict().refine((identity) => Object.keys(identity).length > 0, {
21624
21624
  message: "Session identity requires at least one field"
21625
21625
  });
21626
- var SessionSpecSchema = external_exports.object({
21627
- profile: ResourceNameSchema,
21626
+ var SessionSpecFieldsSchema = external_exports.object({
21627
+ profile: ResourceNameSchema.optional(),
21628
+ harness: external_exports.enum(PROFILE_HARNESSES).optional(),
21629
+ systemPrompt: external_exports.string().trim().min(1).max(1e5).optional(),
21630
+ environment: ResourceNameSchema.optional(),
21628
21631
  identity: SessionIdentitySchema.optional(),
21629
21632
  initialPrompt: external_exports.string().trim().min(1).max(2e4).optional(),
21630
21633
  env: SecretEnvSchema.default({}),
@@ -21633,9 +21636,31 @@ var SessionSpecSchema = external_exports.object({
21633
21636
  workingDirectory: external_exports.string().trim().min(1).optional(),
21634
21637
  tools: SessionToolsSchema.default({})
21635
21638
  });
21636
- var SessionApplySpecSchema = SessionSpecSchema.extend({
21639
+ function validateSessionRunnableConfig(spec, context) {
21640
+ if (spec.profile) {
21641
+ return;
21642
+ }
21643
+ if (!spec.harness) {
21644
+ context.addIssue({
21645
+ code: external_exports.ZodIssueCode.custom,
21646
+ path: ["harness"],
21647
+ message: "Session requires harness when profile is omitted"
21648
+ });
21649
+ }
21650
+ if (!spec.environment) {
21651
+ context.addIssue({
21652
+ code: external_exports.ZodIssueCode.custom,
21653
+ path: ["environment"],
21654
+ message: "Session requires environment when profile is omitted"
21655
+ });
21656
+ }
21657
+ }
21658
+ var SessionSpecSchema = SessionSpecFieldsSchema.superRefine(
21659
+ validateSessionRunnableConfig
21660
+ );
21661
+ var SessionApplySpecSchema = SessionSpecFieldsSchema.extend({
21637
21662
  triggers: SessionApplyTriggersSchema.default([])
21638
- });
21663
+ }).superRefine(validateSessionRunnableConfig);
21639
21664
  var SessionStatusSchema = external_exports.object({
21640
21665
  runCount: external_exports.number().int().nonnegative().default(0)
21641
21666
  }).default({ runCount: 0 });
@@ -26269,7 +26294,7 @@ Object.assign(lookup, {
26269
26294
  // package.json
26270
26295
  var package_default = {
26271
26296
  name: "@autohq/cli",
26272
- version: "0.1.124",
26297
+ version: "0.1.125",
26273
26298
  license: "SEE LICENSE IN README.md",
26274
26299
  publishConfig: {
26275
26300
  access: "public"
package/dist/index.js CHANGED
@@ -18116,6 +18116,25 @@ function isAvatarAssetPathShapeValid(asset) {
18116
18116
  const lower = normalized.toLowerCase();
18117
18117
  return AVATAR_ASSET_EXTENSIONS.some((ext) => lower.endsWith(ext));
18118
18118
  }
18119
+ function validateSessionRunnableConfig(spec, context) {
18120
+ if (spec.profile) {
18121
+ return;
18122
+ }
18123
+ if (!spec.harness) {
18124
+ context.addIssue({
18125
+ code: external_exports.ZodIssueCode.custom,
18126
+ path: ["harness"],
18127
+ message: "Session requires harness when profile is omitted"
18128
+ });
18129
+ }
18130
+ if (!spec.environment) {
18131
+ context.addIssue({
18132
+ code: external_exports.ZodIssueCode.custom,
18133
+ path: ["environment"],
18134
+ message: "Session requires environment when profile is omitted"
18135
+ });
18136
+ }
18137
+ }
18119
18138
  function validateTriggerChecks(trigger, context, eventKeys) {
18120
18139
  const checks = trigger.checks ?? [];
18121
18140
  if (checks.length === 0) {
@@ -18239,7 +18258,7 @@ function isChatMessageEvent(trigger) {
18239
18258
  function hasFilterValue(trigger, path2, expected) {
18240
18259
  return trigger.where?.[path2] === expected;
18241
18260
  }
18242
- var RESOURCE_KIND_SESSION, TriggerFilterScalarSchema, TriggerFilterPathSchema, TriggerFilterClauseSchema, TriggerFilterSchema, SessionTriggerCheckTimeoutSchema, TriggerEventSchema, TriggerEventsSchema, SessionTriggerSharedFields, SessionTriggerEventSourceFields, SessionTriggerBaseSchema, SessionTriggerDefinitionBaseSchema, SessionTriggerSchema, SessionApplyTriggerSchema, SessionHeartbeatTriggerBaseSchema, SessionHeartbeatTriggerSchema, SessionApplyHeartbeatTriggerSchema, SessionTriggerDefinitionSchema, SessionApplyTriggerDefinitionSchema, SessionTriggersSchema, SessionApplyTriggersSchema, AVATAR_ASSET_EXTENSIONS, MAX_AVATAR_ASSET_BYTES, MIN_AVATAR_ASSET_DIMENSION_PX, MAX_AVATAR_ASSET_DIMENSION_PX, PNG_SIGNATURE, SESSION_IDENTITY_DESCRIPTION_MAX_LENGTH, SHA256_HEX_PATTERN, SessionIdentitySchema, SessionSpecSchema, SessionApplySpecSchema, SessionStatusSchema, SessionResourceSchema, SessionApplyRequestSchema, SessionApplyTriggerReceiptSchema, SessionApplyResponseSchema, SESSION_TELEGRAM_IDENTITY_STATUSES, SessionTelegramIdentityStatusSchema, SessionPresenceIdentitySchema, SessionPresenceResponseSchema, SessionPresenceConnectRequestSchema, SessionPresenceConnectPendingSchema, SessionPresenceConnectResponseSchema, SessionPresenceIconRequestSchema, SessionPresenceIconResponseSchema, SessionPresenceCompleteResponseSchema;
18261
+ var RESOURCE_KIND_SESSION, TriggerFilterScalarSchema, TriggerFilterPathSchema, TriggerFilterClauseSchema, TriggerFilterSchema, SessionTriggerCheckTimeoutSchema, TriggerEventSchema, TriggerEventsSchema, SessionTriggerSharedFields, SessionTriggerEventSourceFields, SessionTriggerBaseSchema, SessionTriggerDefinitionBaseSchema, SessionTriggerSchema, SessionApplyTriggerSchema, SessionHeartbeatTriggerBaseSchema, SessionHeartbeatTriggerSchema, SessionApplyHeartbeatTriggerSchema, SessionTriggerDefinitionSchema, SessionApplyTriggerDefinitionSchema, SessionTriggersSchema, SessionApplyTriggersSchema, AVATAR_ASSET_EXTENSIONS, MAX_AVATAR_ASSET_BYTES, MIN_AVATAR_ASSET_DIMENSION_PX, MAX_AVATAR_ASSET_DIMENSION_PX, PNG_SIGNATURE, SESSION_IDENTITY_DESCRIPTION_MAX_LENGTH, SHA256_HEX_PATTERN, SessionIdentitySchema, SessionSpecFieldsSchema, SessionSpecSchema, SessionApplySpecSchema, SessionStatusSchema, SessionResourceSchema, SessionApplyRequestSchema, SessionApplyTriggerReceiptSchema, SessionApplyResponseSchema, SESSION_TELEGRAM_IDENTITY_STATUSES, SessionTelegramIdentityStatusSchema, SessionPresenceIdentitySchema, SessionPresenceResponseSchema, SessionPresenceConnectRequestSchema, SessionPresenceConnectPendingSchema, SessionPresenceConnectResponseSchema, SessionPresenceIconRequestSchema, SessionPresenceIconResponseSchema, SessionPresenceCompleteResponseSchema;
18243
18262
  var init_sessions = __esm({
18244
18263
  "../../packages/schemas/src/sessions.ts"() {
18245
18264
  "use strict";
@@ -18247,6 +18266,7 @@ var init_sessions = __esm({
18247
18266
  init_connections();
18248
18267
  init_mounts();
18249
18268
  init_primitives();
18269
+ init_profiles2();
18250
18270
  init_resources();
18251
18271
  init_secrets();
18252
18272
  init_tools();
@@ -18442,8 +18462,11 @@ var init_sessions = __esm({
18442
18462
  }).strict().refine((identity2) => Object.keys(identity2).length > 0, {
18443
18463
  message: "Session identity requires at least one field"
18444
18464
  });
18445
- SessionSpecSchema = external_exports.object({
18446
- profile: ResourceNameSchema,
18465
+ SessionSpecFieldsSchema = external_exports.object({
18466
+ profile: ResourceNameSchema.optional(),
18467
+ harness: external_exports.enum(PROFILE_HARNESSES).optional(),
18468
+ systemPrompt: external_exports.string().trim().min(1).max(1e5).optional(),
18469
+ environment: ResourceNameSchema.optional(),
18447
18470
  identity: SessionIdentitySchema.optional(),
18448
18471
  initialPrompt: external_exports.string().trim().min(1).max(2e4).optional(),
18449
18472
  env: SecretEnvSchema.default({}),
@@ -18452,9 +18475,12 @@ var init_sessions = __esm({
18452
18475
  workingDirectory: external_exports.string().trim().min(1).optional(),
18453
18476
  tools: SessionToolsSchema.default({})
18454
18477
  });
18455
- SessionApplySpecSchema = SessionSpecSchema.extend({
18478
+ SessionSpecSchema = SessionSpecFieldsSchema.superRefine(
18479
+ validateSessionRunnableConfig
18480
+ );
18481
+ SessionApplySpecSchema = SessionSpecFieldsSchema.extend({
18456
18482
  triggers: SessionApplyTriggersSchema.default([])
18457
- });
18483
+ }).superRefine(validateSessionRunnableConfig);
18458
18484
  SessionStatusSchema = external_exports.object({
18459
18485
  runCount: external_exports.number().int().nonnegative().default(0)
18460
18486
  }).default({ runCount: 0 });
@@ -21237,7 +21263,7 @@ var init_package = __esm({
21237
21263
  "package.json"() {
21238
21264
  package_default = {
21239
21265
  name: "@autohq/cli",
21240
- version: "0.1.124",
21266
+ version: "0.1.125",
21241
21267
  license: "SEE LICENSE IN README.md",
21242
21268
  publishConfig: {
21243
21269
  access: "public"
@@ -25070,7 +25096,7 @@ function connectionProvidersQueryOptions(client, apiUrl, enabled = true) {
25070
25096
  }
25071
25097
  function sortSessions(list) {
25072
25098
  return list.slice().sort(
25073
- (a, b) => a.spec.profile.localeCompare(b.spec.profile) || a.metadata.name.localeCompare(b.metadata.name)
25099
+ (a, b) => (a.spec.profile ?? "").localeCompare(b.spec.profile ?? "") || a.metadata.name.localeCompare(b.metadata.name)
25074
25100
  );
25075
25101
  }
25076
25102
  function sortByName(list) {
@@ -25839,14 +25865,14 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25839
25865
  });
25840
25866
  }, [visibleRunIdKey]);
25841
25867
  useEffect3(() => {
25842
- if (!selectedSession) return;
25868
+ if (!selectedSession?.spec.profile) return;
25843
25869
  const index = profiles.findIndex(
25844
25870
  (profile) => profile.metadata.name === selectedSession.spec.profile
25845
25871
  );
25846
25872
  if (index >= 0) setProfileIndex(index);
25847
25873
  }, [profiles, selectedSession]);
25848
25874
  useEffect3(() => {
25849
- const environmentName = selectedProfile?.spec.environment ?? profiles.find(
25875
+ const environmentName = selectedProfile?.spec.environment ?? selectedSession?.spec.environment ?? profiles.find(
25850
25876
  (profile) => profile.metadata.name === selectedSession?.spec.profile
25851
25877
  )?.spec.environment;
25852
25878
  if (!environmentName) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.124",
3
+ "version": "0.1.125",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"