@sixb/app 0.2.6 → 0.2.7

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 (57) hide show
  1. package/dist/agent/components/sandbox-recovery.d.ts +8 -2
  2. package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
  3. package/dist/agent/delegation/use-children.d.ts +5 -5
  4. package/dist/agent/delegation/use-children.d.ts.map +1 -1
  5. package/dist/agent/hooks/thread-queries.d.ts +8 -8
  6. package/dist/agent/hooks/thread-queries.d.ts.map +1 -1
  7. package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
  8. package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
  9. package/dist/agent/i18n/en.d.ts +5 -0
  10. package/dist/agent/i18n/en.d.ts.map +1 -1
  11. package/dist/agent/i18n/fr.d.ts.map +1 -1
  12. package/dist/agent/i18n/index.d.ts +10 -0
  13. package/dist/agent/i18n/index.d.ts.map +1 -1
  14. package/dist/artifacts/queries.d.ts.map +1 -1
  15. package/dist/artifacts/renderers/live-frame.d.ts.map +1 -1
  16. package/dist/{chunk-ezntd3yy.js → chunk-1f4h75n3.js} +1 -1
  17. package/dist/{chunk-qjw5r2vk.js → chunk-7v9622qb.js} +25 -11
  18. package/dist/{chunk-qjw5r2vk.js.map → chunk-7v9622qb.js.map} +6 -6
  19. package/dist/{chunk-096d52h2.js → chunk-dntecmwb.js} +1 -1
  20. package/dist/{chunk-94d7enwc.js → chunk-qmka6aea.js} +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/pages/console/data/accounts.d.ts.map +1 -1
  23. package/dist/pages/console/data/connectors.d.ts.map +1 -1
  24. package/dist/pages/console/data/datasets.d.ts.map +1 -1
  25. package/dist/pages/console/data/pipelines.d.ts.map +1 -1
  26. package/dist/pages/console/data/projections.d.ts.map +1 -1
  27. package/dist/pages/console/data/syncs.d.ts.map +1 -1
  28. package/dist/pages/console/ontology/actions.d.ts.map +1 -1
  29. package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
  30. package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
  31. package/dist/pages/console/ontology/rules.d.ts.map +1 -1
  32. package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
  33. package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
  34. package/dist/pages/folders.d.ts +106 -0
  35. package/dist/pages/folders.d.ts.map +1 -0
  36. package/dist/pages.js +5234 -4904
  37. package/dist/pages.js.map +15 -14
  38. package/package.json +3 -3
  39. package/src/agent/components/sandbox-recovery.tsx +24 -6
  40. package/src/agent/hooks/use-agent-conversation.ts +7 -0
  41. package/src/agent/i18n/en.ts +6 -0
  42. package/src/agent/i18n/fr.ts +6 -0
  43. package/src/pages/console/data/connectors.tsx +60 -49
  44. package/src/pages/console/data/datasets.tsx +79 -68
  45. package/src/pages/console/data/pipelines.tsx +80 -69
  46. package/src/pages/console/data/projections.tsx +111 -82
  47. package/src/pages/console/data/syncs.tsx +62 -52
  48. package/src/pages/console/ontology/actions.tsx +51 -24
  49. package/src/pages/console/ontology/object-type.tsx +5 -1
  50. package/src/pages/console/ontology/object-types.tsx +41 -32
  51. package/src/pages/console/ontology/rules.tsx +48 -38
  52. package/src/pages/console/ontology/workflow.tsx +9 -3
  53. package/src/pages/console/ontology/workflows.tsx +55 -67
  54. package/src/pages/folders.tsx +335 -0
  55. /package/dist/{chunk-ezntd3yy.js.map → chunk-1f4h75n3.js.map} +0 -0
  56. /package/dist/{chunk-096d52h2.js.map → chunk-dntecmwb.js.map} +0 -0
  57. /package/dist/{chunk-94d7enwc.js.map → chunk-qmka6aea.js.map} +0 -0
@@ -20,6 +20,13 @@ import { useQuery } from "@tanstack/react-query"
20
20
  import { BellRing, ChevronRight, ListChecks, type LucideIcon, Search } from "lucide-react"
21
21
  import { useMemo, useState } from "react"
22
22
  import { useNavigate, useParams } from "react-router-dom"
23
+ import {
24
+ type FolderBrowser,
25
+ FolderContents,
26
+ folderBack,
27
+ noItems,
28
+ useFolderBrowser,
29
+ } from "../../folders"
23
30
  import { objectHref, ruleHref } from "../../routes"
24
31
  import { DetailFallback, SectionPage } from "../../section-page"
25
32
  import {
@@ -380,7 +387,7 @@ function RuleTableView({
380
387
  activeCount,
381
388
  onSelect,
382
389
  }: {
383
- rules: ListRulesResponse
390
+ rules: readonly ListRulesResponse[number][]
384
391
  activeCount: (ruleId: string) => ActiveStateCount
385
392
  onSelect: (ruleId: string) => void
386
393
  }) {
@@ -654,13 +661,13 @@ function RuleStatesSkeleton() {
654
661
 
655
662
  function RulesContent({
656
663
  rules,
657
- filteredRules,
664
+ browser,
658
665
  viewStyle,
659
666
  activeCount,
660
667
  onSelectRule,
661
668
  }: {
662
- rules: ListRulesResponse
663
- filteredRules: ListRulesResponse
669
+ rules: readonly ListRulesResponse[number][]
670
+ browser: FolderBrowser<ListRulesResponse[number]>
664
671
  viewStyle: RulesListViewStyle
665
672
  activeCount: (ruleId: string) => ActiveStateCount
666
673
  onSelectRule: (ruleId: string) => void
@@ -675,7 +682,7 @@ function RulesContent({
675
682
  )
676
683
  }
677
684
 
678
- if (filteredRules.length === 0) {
685
+ if (browser.items.length === 0 && browser.folders.length === 0) {
679
686
  return (
680
687
  <EmptyState
681
688
  icon={<Search className="h-9 w-9" />}
@@ -686,21 +693,25 @@ function RulesContent({
686
693
  )
687
694
  }
688
695
 
689
- if (viewStyle === "table") {
690
- return <RuleTableView rules={filteredRules} activeCount={activeCount} onSelect={onSelectRule} />
691
- }
692
-
693
696
  return (
694
- <CollectionCardGrid>
695
- {filteredRules.map((rule) => (
696
- <RuleListItem
697
- key={rule.id}
698
- rule={rule}
699
- activeCount={activeCount(rule.id)}
700
- onSelect={() => onSelectRule(rule.id)}
701
- />
702
- ))}
703
- </CollectionCardGrid>
697
+ <FolderContents browser={browser} rootLabel="Rules">
698
+ {(shown) =>
699
+ viewStyle === "table" ? (
700
+ <RuleTableView rules={shown} activeCount={activeCount} onSelect={onSelectRule} />
701
+ ) : (
702
+ <CollectionCardGrid>
703
+ {shown.map((rule) => (
704
+ <RuleListItem
705
+ key={rule.id}
706
+ rule={rule}
707
+ activeCount={activeCount(rule.id)}
708
+ onSelect={() => onSelectRule(rule.id)}
709
+ />
710
+ ))}
711
+ </CollectionCardGrid>
712
+ )
713
+ }
714
+ </FolderContents>
704
715
  )
705
716
  }
706
717
 
@@ -715,7 +726,7 @@ export function ConsoleRulesPage() {
715
726
  getCollectionViewStyle("rules", ["cards", "table"], "cards")
716
727
  )
717
728
 
718
- const rules = rulesQuery.data ?? []
729
+ const rules = rulesQuery.data ?? noItems
719
730
  const states = statesQuery.data?.states ?? []
720
731
  const unknownStates = unknownActiveStates(statesQuery)
721
732
  const activeCountByRule = useMemo(() => {
@@ -730,13 +741,14 @@ export function ConsoleRulesPage() {
730
741
  const activeCount = (ruleId: string): ActiveStateCount =>
731
742
  unknownStates ?? { kind: "known", count: activeCountByRule.get(ruleId) ?? 0 }
732
743
 
744
+ const query = searchQuery.trim().toLowerCase()
733
745
  const filteredRules = useMemo(() => {
734
- const query = searchQuery.trim().toLowerCase()
735
746
  if (!query) return rules
736
747
 
737
748
  return rules.filter((rule) => {
738
749
  return (
739
750
  rule.id.toLowerCase().includes(query) ||
751
+ rule.folder?.toLowerCase().includes(query) ||
740
752
  rule.subject.objectTypeId.toLowerCase().includes(query) ||
741
753
  predicateSearchText(rule.predicate).toLowerCase().includes(query) ||
742
754
  rule.dependencies.some((dependency) =>
@@ -744,26 +756,24 @@ export function ConsoleRulesPage() {
744
756
  )
745
757
  )
746
758
  })
747
- }, [rules, searchQuery])
759
+ }, [rules, query])
760
+ const browser = useFolderBrowser({
761
+ items: filteredRules,
762
+ title: "Rules",
763
+ meta: rulesQuery.isPending ? (
764
+ <CountSkeleton />
765
+ ) : rulesQuery.data ? (
766
+ <span>{`${rules.length} rule${rules.length === 1 ? "" : "s"}`}</span>
767
+ ) : undefined,
768
+ narrowed: query.length > 0,
769
+ })
748
770
 
749
771
  const handleSelectRule = (ruleId: string) => {
750
772
  navigate(ruleHref(ruleId))
751
773
  }
752
774
 
753
775
  return (
754
- <SectionPage
755
- section="console"
756
- page="rules"
757
- width="wide"
758
- title="Rules"
759
- meta={
760
- rulesQuery.isPending ? (
761
- <CountSkeleton />
762
- ) : rulesQuery.data ? (
763
- <span>{`${rules.length} rule${rules.length === 1 ? "" : "s"}`}</span>
764
- ) : undefined
765
- }
766
- >
776
+ <SectionPage section="console" page="rules" width="wide" {...browser.frame}>
767
777
  {rulesQuery.isError ? (
768
778
  <LoadFailure icon={ListChecks} error={rulesQuery.error} />
769
779
  ) : (
@@ -772,7 +782,7 @@ export function ConsoleRulesPage() {
772
782
  <CollectionToolbar
773
783
  search={{
774
784
  value: searchQuery,
775
- placeholder: "Search rules, subjects, or predicates…",
785
+ placeholder: "Search rules, folders, subjects, or predicates…",
776
786
  onChange: setSearchQuery,
777
787
  }}
778
788
  actions={
@@ -801,7 +811,7 @@ export function ConsoleRulesPage() {
801
811
  ) : (
802
812
  <RulesContent
803
813
  rules={rules}
804
- filteredRules={filteredRules}
814
+ browser={browser}
805
815
  viewStyle={viewStyle}
806
816
  activeCount={activeCount}
807
817
  onSelectRule={handleSelectRule}
@@ -842,7 +852,7 @@ export function ConsoleRulePage() {
842
852
  navigate(objectHref(state.subject.objectTypeId, state.subject.primaryId))
843
853
  }
844
854
 
845
- const back = { href: "/console/rules", label: "Rules" }
855
+ const back = folderBack({ href: "/console/rules", label: "Rules" }, rule?.folder)
846
856
  if (!rule) {
847
857
  return (
848
858
  <DetailFallback
@@ -44,6 +44,7 @@ import {
44
44
  } from "lucide-react"
45
45
  import { type ReactNode, useEffect, useMemo } from "react"
46
46
  import { Navigate, useNavigate, useParams, useSearchParams } from "react-router-dom"
47
+ import { folderBack } from "../../folders"
47
48
  import { DetailFallback, SectionWorkspace } from "../../section-page"
48
49
  import {
49
50
  CopyButton,
@@ -156,12 +157,17 @@ export function ConsoleWorkflowPage() {
156
157
  return <Navigate to="/console/workflows" replace />
157
158
  }
158
159
 
160
+ const back = folderBack(
161
+ { href: "/console/workflows", label: "Workflows" },
162
+ workflowQuery.data?.folder
163
+ )
164
+
159
165
  if (!workflowQuery.data) {
160
166
  return (
161
167
  <DetailFallback
162
168
  section="console"
163
169
  page="workflows"
164
- back={{ href: "/console/workflows", label: "Workflows" }}
170
+ back={back}
165
171
  name={workflowId}
166
172
  id={workflowId}
167
173
  icon={GitBranch}
@@ -170,7 +176,7 @@ export function ConsoleWorkflowPage() {
170
176
  <div className="relative min-h-0 w-full flex-1">
171
177
  <WorkflowHeader
172
178
  workflowId={workflowId}
173
- onBack={() => navigate("/console/workflows")}
179
+ onBack={() => navigate(back.href)}
174
180
  facts={
175
181
  <span>
176
182
  <SkeletonText className="h-2 w-40" />
@@ -273,7 +279,7 @@ export function ConsoleWorkflowPage() {
273
279
 
274
280
  <WorkflowHeader
275
281
  workflowId={workflow.id}
276
- onBack={() => navigate("/console/workflows")}
282
+ onBack={() => navigate(back.href)}
277
283
  facts={
278
284
  activeRunId && runDetail ? (
279
285
  <>
@@ -3,6 +3,7 @@ import { useQuery } from "@tanstack/react-query"
3
3
  import { Search, Workflow } from "lucide-react"
4
4
  import { useMemo } from "react"
5
5
  import { useSearchParams } from "react-router-dom"
6
+ import { FolderContents, noItems, useFolderBrowser } from "../../folders"
6
7
  import { SectionPage } from "../../section-page"
7
8
  import { PanelEmpty, useLoadFailure } from "../../section-ui"
8
9
  import { CardSkeleton, CountSkeleton } from "../skeletons"
@@ -15,37 +16,26 @@ import { WorkflowCard } from "./workflows/workflow-card"
15
16
  /** Console › Workflows: every workflow with its latest run; each opens its canvas. */
16
17
  export function ConsoleWorkflowsPage() {
17
18
  useWorkflowLiveUpdates()
18
- const countQuery = useQuery({ ...listWorkflowsOptions(), retry: false })
19
- const count = countQuery.data?.length
20
- return (
21
- <SectionPage
22
- section="console"
23
- page="workflows"
24
- width="wide"
25
- title="Workflows"
26
- meta={
27
- countQuery.isPending ? (
28
- <CountSkeleton />
29
- ) : count === undefined ? undefined : (
30
- <span>{`${count} workflow${count === 1 ? "" : "s"}`}</span>
31
- )
32
- }
33
- >
34
- <WorkflowDefinitionsTab />
35
- </SectionPage>
36
- )
37
- }
38
-
39
- function WorkflowDefinitionsTab() {
40
19
  const workflowsQuery = useQuery({ ...listWorkflowsOptions(), retry: false })
41
20
  const [searchParams, setSearchParams] = useSearchParams()
42
- const workflows = workflowsQuery.data ?? []
21
+ const workflows = workflowsQuery.data ?? noItems
22
+ const count = workflowsQuery.data?.length
43
23
  const query = searchParams.get("q") ?? ""
24
+ const normalizedQuery = query.trim().toLowerCase()
44
25
  const filteredWorkflows = useMemo(() => {
45
- const normalizedQuery = query.trim().toLowerCase()
46
26
  if (!normalizedQuery) return workflows
47
27
  return workflows.filter((workflow) => workflowSearchText(workflow).includes(normalizedQuery))
48
- }, [query, workflows])
28
+ }, [normalizedQuery, workflows])
29
+ const browser = useFolderBrowser({
30
+ items: filteredWorkflows,
31
+ title: "Workflows",
32
+ meta: workflowsQuery.isPending ? (
33
+ <CountSkeleton />
34
+ ) : count === undefined ? undefined : (
35
+ <span>{`${count} workflow${count === 1 ? "" : "s"}`}</span>
36
+ ),
37
+ narrowed: normalizedQuery.length > 0,
38
+ })
49
39
 
50
40
  const updateQuery = (value: string) => {
51
41
  setSearchParams(
@@ -64,11 +54,11 @@ function WorkflowDefinitionsTab() {
64
54
  search={{
65
55
  value: query,
66
56
  onChange: updateQuery,
67
- placeholder: "Search workflows, nodes, triggers, or inputs…",
57
+ placeholder: "Search workflows, folders, nodes, triggers, or inputs…",
68
58
  }}
69
59
  // The header counts every workflow; while searching, this counts the matches.
70
60
  actions={
71
- query.trim() && !workflowsQuery.isPending ? (
61
+ normalizedQuery && !workflowsQuery.isPending ? (
72
62
  <p className="px-1 text-xs tabular-nums text-muted-foreground">
73
63
  {`${filteredWorkflows.length} of ${workflows.length} workflows`}
74
64
  </p>
@@ -77,51 +67,48 @@ function WorkflowDefinitionsTab() {
77
67
  />
78
68
  )
79
69
 
80
- if (workflowsQuery.isPending) {
81
- return (
82
- <section className="-mt-4 space-y-4">
83
- {toolbar}
84
- <div className="grid gap-3 lg:grid-cols-2">
85
- {Array.from({ length: 4 }, (_, index) => (
86
- <CardSkeleton key={index} />
87
- ))}
88
- </div>
89
- </section>
90
- )
91
- }
92
-
93
- if (workflowsQuery.isError) {
94
- return <WorkflowsFailure error={workflowsQuery.error} />
95
- }
96
-
97
- if (workflows.length === 0) {
98
- return (
99
- <PanelEmpty
100
- icon={Workflow}
101
- title="No workflows registered"
102
- description="Create a workflow definition to see it appear here."
103
- />
104
- )
105
- }
106
-
107
70
  return (
108
- <section className="-mt-4 space-y-4">
109
- {toolbar}
110
-
111
- {filteredWorkflows.length === 0 ? (
71
+ <SectionPage section="console" page="workflows" width="wide" {...browser.frame}>
72
+ {workflowsQuery.isPending ? (
73
+ <section className="-mt-4 space-y-4">
74
+ {toolbar}
75
+ <div className="grid gap-3 lg:grid-cols-2">
76
+ {Array.from({ length: 4 }, (_, index) => (
77
+ <CardSkeleton key={index} />
78
+ ))}
79
+ </div>
80
+ </section>
81
+ ) : workflowsQuery.isError ? (
82
+ <WorkflowsFailure error={workflowsQuery.error} />
83
+ ) : workflows.length === 0 ? (
112
84
  <PanelEmpty
113
- icon={Search}
114
- title="No matching workflows"
115
- description="Try another workflow name, node, trigger, or input."
85
+ icon={Workflow}
86
+ title="No workflows registered"
87
+ description="Create a workflow definition to see it appear here."
116
88
  />
117
89
  ) : (
118
- <div className="grid gap-3 lg:grid-cols-2">
119
- {filteredWorkflows.map((workflow) => (
120
- <WorkflowCard key={workflow.id} workflow={workflow} />
121
- ))}
122
- </div>
90
+ <section className="-mt-4 space-y-4">
91
+ {toolbar}
92
+ {filteredWorkflows.length === 0 ? (
93
+ <PanelEmpty
94
+ icon={Search}
95
+ title="No matching workflows"
96
+ description="Try another workflow name, folder, node, trigger, or input."
97
+ />
98
+ ) : (
99
+ <FolderContents browser={browser} rootLabel="Workflows">
100
+ {(shown) => (
101
+ <div className="grid gap-3 lg:grid-cols-2">
102
+ {shown.map((workflow) => (
103
+ <WorkflowCard key={workflow.id} workflow={workflow} />
104
+ ))}
105
+ </div>
106
+ )}
107
+ </FolderContents>
108
+ )}
109
+ </section>
123
110
  )}
124
- </section>
111
+ </SectionPage>
125
112
  )
126
113
  }
127
114
 
@@ -147,6 +134,7 @@ function workflowSearchText(workflow: WorkflowSummary): string {
147
134
  return [
148
135
  workflow.id,
149
136
  humanizeIdentifier(workflow.id),
137
+ workflow.folder ?? "",
150
138
  ...Object.keys(workflow.input ?? {}),
151
139
  ...workflow.triggers.map((trigger) => trigger.scheduleId),
152
140
  ...nodeValues,