@team-semicolon/semicolony-cli 4.18.75 → 4.18.76
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/bundle.js +1401 -1380
- package/migrations/182_worker_agent_installation_kind.sql +77 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
-- 182_worker_agent_installation_kind.sql
|
|
2
|
+
--
|
|
3
|
+
-- Distinguish human-operated worker devices from service-hive Agent runtime
|
|
4
|
+
-- installations without replacing the existing worker_devices compatibility
|
|
5
|
+
-- key or changing any existing Human row identity.
|
|
6
|
+
|
|
7
|
+
ALTER TABLE semicolony.worker_devices
|
|
8
|
+
ADD COLUMN IF NOT EXISTS installation_kind TEXT NOT NULL DEFAULT 'human-device';
|
|
9
|
+
|
|
10
|
+
ALTER TABLE semicolony.worker_devices
|
|
11
|
+
ADD CONSTRAINT worker_devices_installation_kind_check
|
|
12
|
+
CHECK (installation_kind IN ('human-device', 'agent-runtime')),
|
|
13
|
+
ADD CONSTRAINT worker_devices_agent_installation_identity_check
|
|
14
|
+
CHECK (
|
|
15
|
+
installation_kind <> 'agent-runtime'
|
|
16
|
+
OR (
|
|
17
|
+
device_id = 'hermes-principals@hermes'
|
|
18
|
+
AND installed_profile_id = 'semo-ops-worker-agent'
|
|
19
|
+
AND kb_access_mode = 'worker-gateway'
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
CREATE INDEX IF NOT EXISTS idx_worker_devices_installation_kind_profile
|
|
24
|
+
ON semicolony.worker_devices (installation_kind, installed_profile_id, status);
|
|
25
|
+
|
|
26
|
+
COMMENT ON COLUMN semicolony.worker_devices.installation_kind IS
|
|
27
|
+
'human-device for a person-operated Worker; agent-runtime for a service-hive Agent installation.';
|
|
28
|
+
|
|
29
|
+
CREATE OR REPLACE VIEW semicolony.v_worker_environment_status AS
|
|
30
|
+
SELECT
|
|
31
|
+
wd.device_id,
|
|
32
|
+
wd.worker_id,
|
|
33
|
+
wd.display_name,
|
|
34
|
+
wd.hostname,
|
|
35
|
+
wd.os,
|
|
36
|
+
wd.workspace_root,
|
|
37
|
+
wd.installed_profile_id,
|
|
38
|
+
wd.installed_profile_version,
|
|
39
|
+
wd.tool_adapters_enabled,
|
|
40
|
+
wd.kb_access_mode,
|
|
41
|
+
wd.last_seen_at,
|
|
42
|
+
wd.last_doctor_status,
|
|
43
|
+
wd.last_doctor_summary,
|
|
44
|
+
wd.setup_progress,
|
|
45
|
+
wd.status,
|
|
46
|
+
wd.updated_at,
|
|
47
|
+
COALESCE(
|
|
48
|
+
jsonb_agg(
|
|
49
|
+
jsonb_build_object(
|
|
50
|
+
'local_hive_id', lh.local_hive_id,
|
|
51
|
+
'workload_type', lh.workload_type,
|
|
52
|
+
'status', lh.status,
|
|
53
|
+
'migration_target', lh.migration_target,
|
|
54
|
+
'expiry_at', lh.expiry_at,
|
|
55
|
+
'last_seen_at', lh.last_seen_at
|
|
56
|
+
)
|
|
57
|
+
) FILTER (WHERE lh.local_hive_id IS NOT NULL),
|
|
58
|
+
'[]'::jsonb
|
|
59
|
+
) AS local_hives,
|
|
60
|
+
wp.active_release_id,
|
|
61
|
+
active_release.version AS active_release_version,
|
|
62
|
+
wd.applied_release_id,
|
|
63
|
+
wd.applied_release_version,
|
|
64
|
+
wd.applied_at,
|
|
65
|
+
wd.installation_kind,
|
|
66
|
+
wd.device_id AS installation_id
|
|
67
|
+
FROM semicolony.worker_devices wd
|
|
68
|
+
LEFT JOIN semicolony.local_hives lh
|
|
69
|
+
ON lh.device_id = wd.device_id
|
|
70
|
+
LEFT JOIN semicolony.workspace_profiles wp
|
|
71
|
+
ON wp.profile_id = wd.installed_profile_id
|
|
72
|
+
LEFT JOIN semicolony.worker_profile_releases active_release
|
|
73
|
+
ON active_release.release_id = wp.active_release_id
|
|
74
|
+
GROUP BY wd.device_id, wp.active_release_id, active_release.version;
|
|
75
|
+
|
|
76
|
+
COMMENT ON COLUMN semicolony.v_worker_environment_status.installation_id IS
|
|
77
|
+
'Runtime-neutral installation identity; backed by device_id for compatibility.';
|