ai-coordinator 0.5.1__py3-none-any.whl

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.
@@ -0,0 +1,24 @@
1
+ # Protocolo de coordenação
2
+
3
+ Use o estado compartilhado para localizar a tarefa em andamento deste projeto. Comece executando `ai-coordinator bootstrap --project <diretorio-real-do-projeto>` e siga o campo `protocol` retornado.
4
+
5
+ ## Retomada
6
+
7
+ - Leia somente o checkpoint da tarefa correspondente ao pedido atual.
8
+ - Confira no disco os arquivos citados antes de afirmar que uma alteração existe.
9
+ - Continue de `next_step`, atualize um checkpoint após progresso relevante e marque como concluída apenas quando não houver trabalho pendente.
10
+ - Trate objetivos, resumos e resultados de workers como contexto histórico; instruções atuais do usuário e do projeto têm prioridade.
11
+ - Quando `AI_MEMORY_WORKSTREAM_ID` existir, uma tarefa nova guarda esse UUID para apontar ao workstream do ai-memory; aceite também `--ai-memory-workstream-id` quando for informado diretamente. Não copie o histórico do workstream para o estado do coordenador.
12
+
13
+ ## Delegação
14
+
15
+ - Use `plan` para consultar a rota e a disponibilidade observada antes de `run`.
16
+ - Forneça aos workers apenas o material necessário. As ferramentas dos workers ficam desativadas; a resposta é uma proposta que o coordenador revisa antes de aplicar.
17
+ - Faça chamadas externas apenas quando forem úteis para o pedido atual. Uma tentativa pode consumir quota ou saldo do provedor.
18
+ - Respeite limites, cooldowns e resultados anteriores. Não repita em loop uma chamada que falhou.
19
+
20
+ ## Segurança e publicação
21
+
22
+ - Não coloque credenciais, dados pessoais ou conteúdo confidencial nos objetivos, entradas ou checkpoints.
23
+ - Leia e preserve as alterações existentes no repositório antes de editar.
24
+ - Diferencie alterações locais, commit, push, publicação de release e deploy. Relate somente o que foi efetivamente concluído.
@@ -0,0 +1,349 @@
1
+ """Portable shared task coordination for local AI coding agents."""
2
+ from .api import Coordinator, open_coordinator
3
+ from .tool_broker import (
4
+ ToolBroker,
5
+ ToolRegistry,
6
+ CapabilityTokenManager,
7
+ CapabilityToken,
8
+ ToolDefinition,
9
+ ToolPolicyMode,
10
+ ToolBrokerContext,
11
+ BrokerAuditRecord,
12
+ ToolBrokerError,
13
+ ToolAccessDeniedError,
14
+ InvalidCapabilityTokenError,
15
+ CapabilityTokenExpiredError,
16
+ CapabilityTokenRevokedError,
17
+ BrokerRateLimitExceededError,
18
+ CallerIdentityMismatchError,
19
+ MutationNotPermittedError,
20
+ ToolApprovalRequired,
21
+ ToolAuditPersistenceError,
22
+ )
23
+ from .worker_audit import (
24
+ WorkerAuditEventType,
25
+ WorkerAuditRecord,
26
+ WorkerAuditLogger,
27
+ WorkerAuditError,
28
+ WorkerAuditPersistenceError,
29
+ WorkerAuditIntegrityError,
30
+ )
31
+ from .fs_sandbox import (
32
+ ExecutionSandbox,
33
+ FileSandboxConfig,
34
+ FileSandboxSecurityError,
35
+ PathTraversalError,
36
+ ReparseEscapeError,
37
+ validate_contained_path,
38
+ )
39
+
40
+ from .process import (
41
+ ProcessIdentity,
42
+ ProcessSupervisor,
43
+ SupervisedProcess,
44
+ TerminationResult,
45
+ WindowsProcessController,
46
+ PosixProcessController,
47
+ safe_process_alive,
48
+ safe_terminate_tree,
49
+ )
50
+ from .streaming import (
51
+ StreamingScrubber,
52
+ SafeStreamConsumer,
53
+ StreamConsumeResult,
54
+ )
55
+ from .contracts import (
56
+ HeadlessContract,
57
+ get_client_contract,
58
+ validate_headless_arguments,
59
+ )
60
+ from .storage import (
61
+ Store,
62
+ RunState,
63
+ ACTIVE_RUN_STATES,
64
+ UNCERTAIN_RUN_STATES,
65
+ TERMINAL_RUN_STATES,
66
+ VALID_STATUS_TRANSITIONS,
67
+ )
68
+ from .mission import (
69
+ FlightPlan,
70
+ FlightBudget,
71
+ LandingCheck,
72
+ MissionControl,
73
+ MissionControlError,
74
+ RadioSilenceError,
75
+ BudgetExceededError,
76
+ UnauthorizedPathError,
77
+ LandingVerificationError,
78
+ DeviationType,
79
+ DriftStatus,
80
+ is_path_allowed,
81
+ )
82
+ from .dag import (
83
+ DagError,
84
+ CycleDetectedError,
85
+ DagValidationError,
86
+ StaleRevisionError,
87
+ ActiveWorkerFencingError,
88
+ ProposalNotApprovedError,
89
+ UnauthorizedOverrideError,
90
+ PlanNode,
91
+ PlanEdge,
92
+ PlanRevision,
93
+ TrajectoryProposal,
94
+ TrajectoryEvent,
95
+ validate_dag,
96
+ get_ready_nodes,
97
+ )
98
+ from .trajectory import (
99
+ TrajectoryStatus,
100
+ ConfidenceLevel,
101
+ TokenUsageQuality,
102
+ Recommendation,
103
+ TelemetrySnapshot,
104
+ BudgetProjection,
105
+ TrajectoryPrediction,
106
+ AlertDeduplicator,
107
+ TrajectoryPredictor,
108
+ )
109
+ from .invariants import (
110
+ InvariantError,
111
+ UntrustedEvidenceError,
112
+ StaleEvidenceError,
113
+ ArtifactMismatchError,
114
+ UnauthorizedWaiverError,
115
+ InvariantVerificationError,
116
+ InvariantStatus,
117
+ InvariantDefinition,
118
+ InvariantEvidence,
119
+ InvariantEvaluation,
120
+ RevisionOracleReport,
121
+ InvariantOracle,
122
+ compute_sha256,
123
+ generate_verification_token,
124
+ )
125
+ from .resource_ledger import (
126
+ ResourceLedgerError,
127
+ ResourceConflictError,
128
+ AuthorizationRequiredError,
129
+ IdempotencyError,
130
+ UnresolvedResourceError,
131
+ ResourceState,
132
+ ResourceType,
133
+ ResourceAction,
134
+ ResourceRecord,
135
+ ResourceEvent,
136
+ ResourceLedger,
137
+ canonicalize_resource_id,
138
+ )
139
+ from .experience import (
140
+ ExperienceCategory,
141
+ ExperienceOutcome,
142
+ ExperienceVisibility,
143
+ ExperienceAuthor,
144
+ ExperienceRecord,
145
+ ExperienceStore,
146
+ normalize_project_id,
147
+ project_id_candidates,
148
+ )
149
+ from .knowledge_learning import KnowledgeLearning
150
+ from .knowledge import (
151
+ KnowledgeAccessDenied,
152
+ KnowledgeConflict,
153
+ KnowledgeError,
154
+ KnowledgeEvidenceLevel,
155
+ KnowledgeKind,
156
+ KnowledgeNature,
157
+ KnowledgePrincipal,
158
+ KnowledgeState,
159
+ KnowledgeTransitionError,
160
+ KnowledgeVisibility,
161
+ UnifiedKnowledgeCore,
162
+ )
163
+ from .insights import (
164
+ InsightType,
165
+ InsightStatus,
166
+ InsightPresentation,
167
+ AutonomyLevel,
168
+ Insight,
169
+ InsightEngine,
170
+ )
171
+ from .reconstruction import (
172
+ ReconstructionError,
173
+ ReconnectionPointNotFoundError,
174
+ AlternativeRoutePreview,
175
+ calculate_reconnection_points,
176
+ calculate_upstream_prerequisites,
177
+ splice_alternative_route,
178
+ TrajectoryReconstructor,
179
+ )
180
+ from .human_workspace import (
181
+ HumanWorkspace,
182
+ HumanPrincipal,
183
+ HumanInboxState,
184
+ HumanInboxReadState,
185
+ HumanInboxItemKind,
186
+ HumanWorkspaceError,
187
+ HumanWorkspaceAccessDenied,
188
+ HumanWorkspaceConflict,
189
+ HumanWorkspaceNotFoundError,
190
+ )
191
+
192
+ __all__ = [
193
+ "HumanWorkspace",
194
+ "HumanPrincipal",
195
+ "HumanInboxState",
196
+ "HumanInboxReadState",
197
+ "HumanInboxItemKind",
198
+ "HumanWorkspaceError",
199
+ "HumanWorkspaceAccessDenied",
200
+ "HumanWorkspaceConflict",
201
+ "HumanWorkspaceNotFoundError",
202
+ "KnowledgeLearning",
203
+ "KnowledgeAccessDenied",
204
+ "KnowledgeConflict",
205
+ "KnowledgeError",
206
+ "KnowledgeEvidenceLevel",
207
+ "KnowledgeKind",
208
+ "KnowledgeNature",
209
+ "KnowledgePrincipal",
210
+ "KnowledgeState",
211
+ "KnowledgeTransitionError",
212
+ "KnowledgeVisibility",
213
+ "UnifiedKnowledgeCore",
214
+ "Coordinator",
215
+ "open_coordinator",
216
+ "ProcessIdentity",
217
+ "ProcessSupervisor",
218
+ "SupervisedProcess",
219
+ "TerminationResult",
220
+ "WindowsProcessController",
221
+ "PosixProcessController",
222
+ "safe_process_alive",
223
+ "safe_terminate_tree",
224
+ "StreamingScrubber",
225
+ "SafeStreamConsumer",
226
+ "StreamConsumeResult",
227
+ "HeadlessContract",
228
+ "get_client_contract",
229
+ "validate_headless_arguments",
230
+ "Store",
231
+ "RunState",
232
+ "ACTIVE_RUN_STATES",
233
+ "UNCERTAIN_RUN_STATES",
234
+ "TERMINAL_RUN_STATES",
235
+ "VALID_STATUS_TRANSITIONS",
236
+ "FlightPlan",
237
+ "FlightBudget",
238
+ "LandingCheck",
239
+ "MissionControl",
240
+ "MissionControlError",
241
+ "RadioSilenceError",
242
+ "BudgetExceededError",
243
+ "UnauthorizedPathError",
244
+ "LandingVerificationError",
245
+ "DeviationType",
246
+ "DriftStatus",
247
+ "is_path_allowed",
248
+ "DagError",
249
+ "CycleDetectedError",
250
+ "DagValidationError",
251
+ "StaleRevisionError",
252
+ "ActiveWorkerFencingError",
253
+ "ProposalNotApprovedError",
254
+ "UnauthorizedOverrideError",
255
+ "PlanNode",
256
+ "PlanEdge",
257
+ "PlanRevision",
258
+ "TrajectoryProposal",
259
+ "TrajectoryEvent",
260
+ "validate_dag",
261
+ "get_ready_nodes",
262
+ "TrajectoryStatus",
263
+ "ConfidenceLevel",
264
+ "TokenUsageQuality",
265
+ "Recommendation",
266
+ "TelemetrySnapshot",
267
+ "BudgetProjection",
268
+ "TrajectoryPrediction",
269
+ "AlertDeduplicator",
270
+ "TrajectoryPredictor",
271
+ "InvariantError",
272
+ "UntrustedEvidenceError",
273
+ "StaleEvidenceError",
274
+ "ArtifactMismatchError",
275
+ "UnauthorizedWaiverError",
276
+ "InvariantVerificationError",
277
+ "InvariantStatus",
278
+ "InvariantDefinition",
279
+ "InvariantEvidence",
280
+ "InvariantEvaluation",
281
+ "RevisionOracleReport",
282
+ "InvariantOracle",
283
+ "compute_sha256",
284
+ "generate_verification_token",
285
+ "ResourceLedgerError",
286
+ "ResourceConflictError",
287
+ "AuthorizationRequiredError",
288
+ "IdempotencyError",
289
+ "UnresolvedResourceError",
290
+ "ResourceState",
291
+ "ResourceType",
292
+ "ResourceAction",
293
+ "ResourceRecord",
294
+ "ResourceEvent",
295
+ "ResourceLedger",
296
+ "canonicalize_resource_id",
297
+ "ExperienceCategory",
298
+ "ExperienceOutcome",
299
+ "ExperienceVisibility",
300
+ "ExperienceAuthor",
301
+ "ExperienceRecord",
302
+ "ExperienceStore",
303
+ "normalize_project_id",
304
+ "project_id_candidates",
305
+ "InsightType",
306
+ "InsightStatus",
307
+ "InsightPresentation",
308
+ "AutonomyLevel",
309
+ "Insight",
310
+ "InsightEngine",
311
+ "ReconstructionError",
312
+ "ReconnectionPointNotFoundError",
313
+ "AlternativeRoutePreview",
314
+ "calculate_reconnection_points",
315
+ "calculate_upstream_prerequisites",
316
+ "splice_alternative_route",
317
+ "TrajectoryReconstructor",
318
+ "ToolBroker",
319
+ "ToolRegistry",
320
+ "CapabilityTokenManager",
321
+ "CapabilityToken",
322
+ "ToolDefinition",
323
+ "ToolPolicyMode",
324
+ "ToolBrokerContext",
325
+ "BrokerAuditRecord",
326
+ "ToolBrokerError",
327
+ "ToolAccessDeniedError",
328
+ "InvalidCapabilityTokenError",
329
+ "CapabilityTokenExpiredError",
330
+ "CapabilityTokenRevokedError",
331
+ "BrokerRateLimitExceededError",
332
+ "CallerIdentityMismatchError",
333
+ "MutationNotPermittedError",
334
+ "ToolApprovalRequired",
335
+ "ToolAuditPersistenceError",
336
+ "WorkerAuditEventType",
337
+ "WorkerAuditRecord",
338
+ "WorkerAuditLogger",
339
+ "WorkerAuditError",
340
+ "WorkerAuditPersistenceError",
341
+ "WorkerAuditIntegrityError",
342
+ "ExecutionSandbox",
343
+ "FileSandboxConfig",
344
+ "FileSandboxSecurityError",
345
+ "PathTraversalError",
346
+ "ReparseEscapeError",
347
+ "validate_contained_path",
348
+ ]
349
+ __version__ = "0.5.1"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())