@halcyonlabs/app 0.47.0-halcyon.464 → 0.47.0-halcyon.466

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/index.d.ts CHANGED
@@ -3008,8 +3008,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3008
3008
  }>;
3009
3009
  name: z$1.ZodString;
3010
3010
  source: z$1.ZodEnum<{
3011
- skill: "skill";
3012
3011
  command: "command";
3012
+ skill: "skill";
3013
3013
  }>;
3014
3014
  origin: z$1.ZodEnum<{
3015
3015
  user: "user";
@@ -3098,8 +3098,8 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3098
3098
  }>;
3099
3099
  name: z$1.ZodString;
3100
3100
  source: z$1.ZodEnum<{
3101
- skill: "skill";
3102
3101
  command: "command";
3102
+ skill: "skill";
3103
3103
  }>;
3104
3104
  origin: z$1.ZodEnum<{
3105
3105
  user: "user";
@@ -3244,10 +3244,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3244
3244
  interaction: z$1.ZodUnion<readonly [z$1.ZodObject<{
3245
3245
  id: z$1.ZodString;
3246
3246
  status: z$1.ZodEnum<{
3247
- resolved: "resolved";
3248
3247
  pending: "pending";
3249
3248
  interrupted: "interrupted";
3250
3249
  resolving: "resolving";
3250
+ resolved: "resolved";
3251
3251
  }>;
3252
3252
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3253
3253
  origin: z$1.ZodObject<{
@@ -3380,10 +3380,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3380
3380
  }, z$1.core.$strip>, z$1.ZodObject<{
3381
3381
  id: z$1.ZodString;
3382
3382
  status: z$1.ZodEnum<{
3383
- resolved: "resolved";
3384
3383
  pending: "pending";
3385
3384
  interrupted: "interrupted";
3386
3385
  resolving: "resolving";
3386
+ resolved: "resolved";
3387
3387
  }>;
3388
3388
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3389
3389
  origin: z$1.ZodObject<{
@@ -3416,10 +3416,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3416
3416
  }, z$1.core.$strip>, z$1.ZodObject<{
3417
3417
  id: z$1.ZodString;
3418
3418
  status: z$1.ZodEnum<{
3419
- resolved: "resolved";
3420
3419
  pending: "pending";
3421
3420
  interrupted: "interrupted";
3422
3421
  resolving: "resolving";
3422
+ resolved: "resolved";
3423
3423
  }>;
3424
3424
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3425
3425
  origin: z$1.ZodObject<{
@@ -3467,10 +3467,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3467
3467
  }, z$1.core.$strip>, z$1.ZodObject<{
3468
3468
  id: z$1.ZodString;
3469
3469
  status: z$1.ZodEnum<{
3470
- resolved: "resolved";
3471
3470
  pending: "pending";
3472
3471
  interrupted: "interrupted";
3473
3472
  resolving: "resolving";
3473
+ resolved: "resolved";
3474
3474
  }>;
3475
3475
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3476
3476
  origin: z$1.ZodObject<{
@@ -3493,10 +3493,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3493
3493
  providerId: z$1.ZodString;
3494
3494
  providerRequestId: z$1.ZodString;
3495
3495
  status: z$1.ZodEnum<{
3496
- resolved: "resolved";
3497
3496
  pending: "pending";
3498
3497
  interrupted: "interrupted";
3499
3498
  resolving: "resolving";
3499
+ resolved: "resolved";
3500
3500
  }>;
3501
3501
  resolution: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
3502
3502
  decision: z$1.ZodLiteral<"allow_once">;
@@ -3545,10 +3545,10 @@ declare const threadEventSchema: z$1.ZodUnion<readonly [z$1.ZodIntersection<z$1.
3545
3545
  providerId: z$1.ZodString;
3546
3546
  providerRequestId: z$1.ZodString;
3547
3547
  status: z$1.ZodEnum<{
3548
- resolved: "resolved";
3549
3548
  pending: "pending";
3550
3549
  interrupted: "interrupted";
3551
3550
  resolving: "resolving";
3551
+ resolved: "resolved";
3552
3552
  }>;
3553
3553
  resolution: z$1.ZodDefault<z$1.ZodNullable<z$1.ZodObject<{
3554
3554
  kind: z$1.ZodLiteral<"user_answer">;
@@ -3670,10 +3670,10 @@ declare const providerPendingInteractionSchema: z$1.ZodUnion<readonly [z$1.ZodOb
3670
3670
  id: z$1.ZodString;
3671
3671
  threadId: z$1.ZodString;
3672
3672
  status: z$1.ZodEnum<{
3673
- resolved: "resolved";
3674
3673
  pending: "pending";
3675
3674
  interrupted: "interrupted";
3676
3675
  resolving: "resolving";
3676
+ resolved: "resolved";
3677
3677
  }>;
3678
3678
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3679
3679
  createdAt: z$1.ZodNumber;
@@ -3820,10 +3820,10 @@ declare const providerPendingInteractionSchema: z$1.ZodUnion<readonly [z$1.ZodOb
3820
3820
  id: z$1.ZodString;
3821
3821
  threadId: z$1.ZodString;
3822
3822
  status: z$1.ZodEnum<{
3823
- resolved: "resolved";
3824
3823
  pending: "pending";
3825
3824
  interrupted: "interrupted";
3826
3825
  resolving: "resolving";
3826
+ resolved: "resolved";
3827
3827
  }>;
3828
3828
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3829
3829
  createdAt: z$1.ZodNumber;
@@ -3865,10 +3865,10 @@ declare const providerPendingInteractionSchema: z$1.ZodUnion<readonly [z$1.ZodOb
3865
3865
  id: z$1.ZodString;
3866
3866
  threadId: z$1.ZodString;
3867
3867
  status: z$1.ZodEnum<{
3868
- resolved: "resolved";
3869
3868
  pending: "pending";
3870
3869
  interrupted: "interrupted";
3871
3870
  resolving: "resolving";
3871
+ resolved: "resolved";
3872
3872
  }>;
3873
3873
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3874
3874
  createdAt: z$1.ZodNumber;
@@ -3899,10 +3899,10 @@ declare const pluginPendingInteractionSchema: z$1.ZodObject<{
3899
3899
  id: z$1.ZodString;
3900
3900
  threadId: z$1.ZodString;
3901
3901
  status: z$1.ZodEnum<{
3902
- resolved: "resolved";
3903
3902
  pending: "pending";
3904
3903
  interrupted: "interrupted";
3905
3904
  resolving: "resolving";
3905
+ resolved: "resolved";
3906
3906
  }>;
3907
3907
  statusReason: z$1.ZodNullable<z$1.ZodString>;
3908
3908
  createdAt: z$1.ZodNumber;
@@ -4016,8 +4016,8 @@ declare const promptTextMentionSchema: z$1.ZodObject<{
4016
4016
  }>;
4017
4017
  name: z$1.ZodString;
4018
4018
  source: z$1.ZodEnum<{
4019
- skill: "skill";
4020
4019
  command: "command";
4020
+ skill: "skill";
4021
4021
  }>;
4022
4022
  origin: z$1.ZodEnum<{
4023
4023
  user: "user";
@@ -4081,8 +4081,8 @@ declare const promptInputSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
4081
4081
  }>;
4082
4082
  name: z$1.ZodString;
4083
4083
  source: z$1.ZodEnum<{
4084
- skill: "skill";
4085
4084
  command: "command";
4085
+ skill: "skill";
4086
4086
  }>;
4087
4087
  origin: z$1.ZodEnum<{
4088
4088
  user: "user";
@@ -4393,8 +4393,8 @@ declare const threadQueuedMessageSchema: z$1.ZodObject<{
4393
4393
  }>;
4394
4394
  name: z$1.ZodString;
4395
4395
  source: z$1.ZodEnum<{
4396
- skill: "skill";
4397
4396
  command: "command";
4397
+ skill: "skill";
4398
4398
  }>;
4399
4399
  origin: z$1.ZodEnum<{
4400
4400
  user: "user";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halcyonlabs/app",
3
- "version": "0.47.0-halcyon.464",
3
+ "version": "0.47.0-halcyon.466",
4
4
  "description": "bb app launcher for npx",
5
5
  "keywords": [
6
6
  "bb",
@@ -105,7 +105,7 @@
105
105
  "node": "^22.19.0 || ^24.0.0 || ^26.0.0"
106
106
  },
107
107
  "moonletRelease": {
108
- "summary": "Repair the logo import and artifact command compatibility (#489)"
108
+ "summary": "Recover disk space without admitting growing work (#492)"
109
109
  },
110
110
  "license": "SEE LICENSE IN LICENSE"
111
111
  }
@@ -613,7 +613,8 @@ class Workspaces:
613
613
  users, unknown = workspace_users(path)
614
614
  if users or unknown:
615
615
  raise ValueError('Workspace writers must be confirmed stopped before saving and cleaning.')
616
- manifest = self.declared_outputs(manifest)
616
+ below_floor = work_free(self) < admission_settings(self.state)['disk_free_bytes']
617
+ manifest = self.declared_outputs(manifest, persist=not below_floor)
617
618
  root = self.open_workspace(job_id)
618
619
  try:
619
620
  checkouts = as_account(account, lambda: dict(paths=[str(p.relative_to(path)) for p in git_checkouts(path, time.monotonic() + UNPUSHED_SECONDS, include_build=True)]))['paths']
@@ -629,6 +630,9 @@ class Workspaces:
629
630
  raise ValueError('A rebuildable folder contains a checkout; unpublished work is kept.')
630
631
  safe_caches.append(parts)
631
632
  caches = safe_caches
633
+ if below_floor:
634
+ reclaim_workspace(root, manifest['outputs'], caches)
635
+ return dict(output=None, unpublished=work['checkouts'])
632
636
  name = 'results/storage-recovery-' + secrets.token_hex(16) + '.tar.gz'
633
637
  outputs, _ = declared_output_names(manifest['outputs'] + [name], strict=True)
634
638
  as_account(account, lambda: save_recovery(root, caches, account, name, outputs))
@@ -1656,22 +1660,60 @@ def git_output(account, checkout, name, *args, allowed=(0,), stdin='', offline=F
1656
1660
  return result
1657
1661
 
1658
1662
 
1659
- def unpushed_checkout(account, checkout, name, deadline=None):
1663
+ def published_archive_tips(directory=Path('/var/db/orbit/exchange/github/out')):
1664
+ tips = set()
1665
+ try:
1666
+ for parent in (directory, *directory.parents):
1667
+ info = parent.lstat()
1668
+ if not stat.S_ISDIR(info.st_mode) or info.st_uid == os.geteuid() or info.st_mode & 0o022:
1669
+ return []
1670
+ with os.scandir(directory) as entries:
1671
+ names = []
1672
+ for entry in entries:
1673
+ if len(names) >= 1000:
1674
+ return []
1675
+ names.append(entry.name)
1676
+ for name in names:
1677
+ if not name.endswith('.retention.json'):
1678
+ continue
1679
+ fd = os.open(directory / name, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK | os.O_CLOEXEC)
1680
+ with os.fdopen(fd) as stream:
1681
+ info = os.fstat(stream.fileno())
1682
+ if not stat.S_ISREG(info.st_mode) or info.st_uid == os.geteuid() or info.st_mode & 0o022 or info.st_nlink != 1 or info.st_size > 8 * 1024 * 1024:
1683
+ continue
1684
+ snapshot = json.load(stream)
1685
+ if not isinstance(snapshot, dict) or type(snapshot.get('at')) is not int or not 0 <= time.time() - snapshot['at'] <= 900:
1686
+ continue
1687
+ heads = snapshot.get('remote_commits', [])
1688
+ pulls = snapshot.get('pulls', [])
1689
+ if not isinstance(heads, list) or len(heads) > 100000 or not isinstance(pulls, list) or len(pulls) > 10000:
1690
+ continue
1691
+ heads = heads + [p.get('head') for p in pulls if isinstance(p, dict) and p.get('state') == 'closed' and p.get('merged_at')]
1692
+ tips.update(head for head in heads if isinstance(head, str) and re.fullmatch('[0-9a-f]{40}', head))
1693
+ except (OSError, ValueError):
1694
+ return []
1695
+ return sorted(tips)
1696
+
1697
+
1698
+ def unpushed_checkout(account, checkout, name, deadline=None, published=None):
1660
1699
  def git(*args, allowed=(0,)):
1661
1700
  return git_output(account, checkout, name, *args, allowed=allowed, deadline=deadline)
1662
1701
 
1663
1702
  def count(*revisions):
1664
1703
  return int(git('rev-list', '--count', *revisions).stdout.strip() or '0')
1665
1704
 
1705
+ local = set(git('for-each-ref', '--format=%(objectname)', 'refs/heads').stdout.split())
1706
+ local.update(git('rev-parse', '-q', '--verify', 'HEAD^{commit}', allowed=(0, 1)).stdout.split())
1707
+ excluded = sorted(local.intersection(published or ()))
1666
1708
  branches = []
1667
1709
  for ref in filter(None, git('for-each-ref', '--format=%(refname)', 'refs/heads').stdout.split('\n')):
1668
- commits = count(ref, '--not', '--remotes')
1710
+ commits = count(ref, '--not', '--remotes', *excluded)
1669
1711
  if commits:
1670
1712
  branches.append(dict(branch=ref[len('refs/heads/'):], commits=commits))
1671
1713
  detached = 0
1672
1714
  if git('symbolic-ref', '-q', 'HEAD', allowed=(0, 1)).returncode == 1:
1673
1715
  if git('rev-parse', '-q', '--verify', 'HEAD^{commit}', allowed=(0, 1)).returncode == 0:
1674
- detached = count('HEAD', '--not', '--remotes', '--branches')
1716
+ detached = count('HEAD', '--not', '--remotes', '--branches', *excluded)
1675
1717
  if git('rev-parse', '-q', '--verify', 'HEAD^{commit}', allowed=(0, 1)).returncode == 0:
1676
1718
  tree = 'HEAD'
1677
1719
  else:
@@ -1690,11 +1732,12 @@ def unpushed_checkout(account, checkout, name, deadline=None):
1690
1732
  def search_unpushed(root, account, seconds, include_build=False):
1691
1733
  deadline = time.monotonic() + seconds
1692
1734
  found = []
1735
+ published = published_archive_tips()
1693
1736
  for checkout in git_checkouts(root, deadline, include_build=include_build):
1694
1737
  if time.monotonic() > deadline:
1695
1738
  raise ValueError('Checking the work folder for unpushed commits took too long.')
1696
1739
  name = str(checkout.relative_to(root))
1697
- work = unpushed_checkout(account, checkout, name, deadline)
1740
+ work = unpushed_checkout(account, checkout, name, deadline, published)
1698
1741
  if work['branches'] or work['detached'] or work['uncommitted'] or work['untracked'] or work['stashes']:
1699
1742
  found.append(dict(path=name, **work))
1700
1743
  return dict(checkouts=found)
@@ -1,15 +1,15 @@
1
1
  {
2
- "commit": "9b399f25548d3f060eebb53153d8abdfd9bdba2b",
2
+ "commit": "76f8840dc886f90126c952c149658b8ced0a6c49",
3
3
  "file": "orbit-deploy",
4
4
  "platform": "linux-x64",
5
5
  "provenance": {
6
- "artifactId": 14706169354,
7
- "artifactName": "linux-bundle-9b399f25548d3f060eebb53153d8abdfd9bdba2b",
6
+ "artifactId": 14715988879,
7
+ "artifactName": "linux-bundle-76f8840dc886f90126c952c149658b8ced0a6c49",
8
8
  "repository": "matt0x6F/personalassistant",
9
- "runId": 44900503856,
9
+ "runId": 44925522669,
10
10
  "workflow": ".github/workflows/moonlet-linux-bundle.yml"
11
11
  },
12
12
  "schema": 1,
13
- "sha256": "a36d4b316890bafa3b730bcd71b744688e80fa53901c68c4c18ac10ab3c5fef9",
14
- "size": 3212000
13
+ "sha256": "b48888509565af9630c6682886d3743b851eded452f37bb43c34ed289176375e",
14
+ "size": 3207904
15
15
  }
@@ -1 +1 @@
1
- 9b399f25548d3f060eebb53153d8abdfd9bdba2b
1
+ 76f8840dc886f90126c952c149658b8ced0a6c49